How to access all the classes in a jar file

hai
i have a custom built JAR file which has many classes(Translets) in it . i want to access the classes inthe JAR file in a JSP page or an servlet. I have tried setting the classpaths etc , but nothing has happened.
Where should the jar file be Palced - i am using Tomcat Server.
How Can i Access the class files .. Very Urgent .. Please Help me ..
Peter Iyer

What is showing a file not found error? The web browser? if so, that's probably not a problem with the jar file.
Also, have you expanded your jar file to make sure that you jarred it up correctly?

Similar Messages

  • How to load all the classes in a JAR file at runtime?

    Any clues o:
    "How can I force JVM to load all the classes in a specified JAR at once?"
    Thanx!
    -Rajeev

    Well I was thinking may be there exists an option with "java", when I
    am starting an application from a jar file, I could force it to load all
    the classes in the JAR. I don't want to do it programically. Is there such
    an option available?? Or in other words can I ask JVM to not do the dynamic
    loading for the JAR??
    Thanx.
    List all JarEntries and convert the paths to fully
    qualified class files
    e.g file in jar
    [1] /com/mycompany/proj/X.class
    should become
    [2] com.mycompany.proj.X
    then for each entry issue
    Class.forName( [2] );

  • How to combine the classes from 2 jar files into 1?

    Hi there
    I have got 2 jar files with the same name but the classes that they contain are different. So, I want to combine those 2 files into 1. Could anyone please tell me how to add the classes in a jar file to another jar file?
    Thanks for your help!
    From
    Edmund

    The jar utility allows you to extract files as well as put them into a jar. This is in the java docs.
    You might have to hand modify the manifest file if it was hand modified in the first place. All you should have to do is copy the text from one file to another. The manifest will have the same name so you will have to extract to different dirs so it isn't overwritten.
    Steps:
    -Create dir1 and dir2
    -Extract jar1 into dir1, Extract jar2 into dir2.
    -Manually examine manifests and combine if needed.
    -Copy files from one dir to another.
    -Use jar tool to create new jar.

  • How do you know the version of a JAR file ?

    how do you know the version of a JAR file ?
    is it what is written on MANIFEST.MF ?
    for example i have a JAR file
    whose MANIFEST.MF has this
    Manifest-Version: 1.0
    Created-By: Ant 1.4.1so, whats the version of this JAR ? 1.0 ?

    anyway, that was JSTL..jar.
    Now, come to another JAR file....
    whose MANIFEST.MF has......
    Manifest-Version: 1.0
    Created-By: Apache Ant 1.5.1
    Extension-Name: Struts Framework
    Specification-Title: Struts Framework
    Specification-Vendor: Apache Software Foundation
    Specification-Version: 1.1
    Implementation-Title: Struts Framework
    Implementation-Vendor: Apache Software Foundation
    Implementation-Vendor-Id: org.apache
    Implementation-Version: 1.1
    Class-Path:  commons-beanutils.jar commons-collections.jar commons-dig
    ester.jar commons-logging.jar commons-validator.jar jakarta-oro.jar s
    truts-legacy.jarso, How do you believe whats the version now ? do u go with the comment "Manifest-Version: 1.0" or "Specification-Version: 1.1" ?
    definitely, you would go with the "Specification-Version: 1.1" and declare this JAR as STRUTS 1.1
    hmmm, so, if nothing is mentioned like above should we follow the MANIFEST version as the JSTL version ? in my earlier example i did not find any comment on ""Specification-Version" ......so , if anybody gives me that JAR , how do i decide whether its 1.0 specification or 1.1 specifucation compliant ?
    can you tell whats the JSTL version of my earler example JAR file ?

  • With POP3 protocol, How Outlook access all the folders

    Hi friends,
    I have some doubts. Our mail server doesn't support the IMAP protocol. When i access the mails using Outlook, then I m able to get all the messages of INBOX as well as Trash & Deleted Messages?
    How it happens, When only INBOX is accessible to user Using POP3 protocol. Using Outlook web access, I m able to access all the folder as well as I m able to create the folders also.
    Can somebody tell me how does it works?

    Outlook uses a Microsoft-specific protocol called MAPI. And your statement that your server doesn't support IMAP isn't quite correct. MS Exchange does support IMAP, but you have to ask the administrator to switch on IMAP support. The default setup for Exchange has it turned off.

  • Adding all the classes and external jars in webservice WAR using servicegen

    Hi,
    Can someone please tell me how do I include all the classes and my external jar files to the ear/war file that is created using servicegen. I don't see any option in servicegen tag where I can include my classes and jar files to the ear/war file. The war it creates only contains the web service implementation class but I want to all the classes in the service code and jars in the same war. Any ideas on how to do that instead of putting in the classpath.
    here is the snippet of my build file
    <servicegen
           destEar="${deploy}/myservice.ear"
           warName="myservice.war">
           <service
             javaClassComponents="com.ws.service.TestService"
             targetNamespace="http://xmlns.test.com/tool/myservice"
             serviceName="myservice"
             serviceURI="/myservice"
             style="document"
             protocol="http"
             expandMethods="True">
           </service>
          <classpath>
            <pathelement path="${classes}"/>
            <pathelement path="${lib}/*.jar"/>
         <pathelement path="C:/bea/weblogic92/server/lib/webserviceclient.jar"/>
          </classpath>      
    </servicegen>
    ..........................Thanks

    Hi,
    The work around I am using to overcome this problem is Unzipping th ear/war file created by servicegen task and including all the classes. Then creating the ear file again by creating a new ant target.
    I know this is not a neater way, but this works for me.

  • How to tell if a class within a jar file is being accessed?

    Hello,
    I have written a web app using NetBeans 5.5 and some external libraries.
    Rome 0.9 and a Rome module georss-rome.jar.
    Everything works fine with the integrated Netbeans tomcat 5.5...
    When I try to deploy this as a war using Tomcat 5.5 standalone It will not work properly. To make things worse, I get no error.
    In my code, I instantiate a class in the georss module by doing the following:
                    GeoRSSModule geoRssModule = GeoRSSUtils.getGeoRSS(entry);
                    if(geoRssModule != null)
    ...do something;
    }I then check for null and if not null I do stuff with methods within that jar.
    Basically I pass a rss feed or a georss feed. If its a georss feed then geoRssModule would not be null.
    As I said, this works fine within integrated tomcat but does nothing (no expected action) with standalone which leads me to believe that this is a deployment/jar/classpath issue.
    To me it seems that the class GeoRSSModule is never actually instantiated, but I never get any errors or expected output.
    I set tomcat logging.properties to FINEST for all types of logging.
    Is there a way to determine if the jar is even being accessed for that class file?
    TIA!
    BTW, I dont have the module source.
    I also verified that the jars (rome.jar and georss-rome.jar) are being deployed to webapps/myapp/WEB-INF/lib
    Message was edited by:
    gforty

    GeoRSSModule geoRssModule = GeoRSSUtils.getGeoRSS(entry);Try placing logging statements before and after this statement so that you can track execution. Make sure that your code at least gets to this particular line where you instantiate the GeoRSSModule object. Then place a logging statement afterwards to see if an object was indeed created.
    What helps me in situations like this is that I also use the NetBeans attached debugger listening on your standalone Tomcat installation. This allows you to trace your execution on the server side, one line at a time, giving you a clearer understanding of program flow.

  • How do i edit the contents of a JAR file?

    i have a file named AdvancedPlayer.java (i edited this one) and there is a file in the Jlayer jar named AdvancedPlayer, how do i switch them?

    you can open your jar archive with WinZip or WinRar, and just delete the old file and put in new one. All the signing will be destroyed thou. So if you want your JAR to still be signed, you want to build your JAR with the correct file already in place.
    Also you know that .java file is source code and not executable like .class file? You prbl want to replace class files not java files.
    Edited by: Crazy_Russian on Jun 14, 2008 7:32 PM

  • How to Invoke a main class in a jar file from my project

    Hi
    I am a new user of the Sun Java Studio enterprise. I would like to know how i can invoke a main method in a jar file associated to the project.
    regards
    Nisanth

    Could you please clarify: do you want to run your project or a project from an independent jar?
    In the first case just select Run Project from the project context menu or select a class with main method and click Run File in the class context menu.
    Regarding the second case:
    - I don't think there is such a feature in the IDE (running third party jars is not an IDE function). Could you explain why you need this?

  • Don't know how to make my main class import a jar file

    OK, the title doesn't make much sense but here are my create-jar.bat and manifest files:
    create-jar.bat:
    jar cvmf manifest.txt dassimul-admin.jar player/ admin/ com/ connector/ common/ *.class
    manifest.txt:
    Main-Class: admin.DASAdmin
    the problem is that in connector/ folder there is the jdbc mysql connector driver (.jar file).
    in Eclipse I can add this jar to the Java Build Path, so the program runs.
    When I double-click the dassimul-admin.jar file, I get a Class Not Found Exception
    C:\MYWORK\dassimul>java -jar dassimul-admin.jar
    FATAL ERROR WHILE LOADING SQL DRIVER: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    I think that the problem lies in the fact that admin.DASAdmin can't see and import the jar file in connector/ folder... am I right?

    It looks like you are putting the mysql jar file inside the dassimul jar. That won't work unless you write custom code. You should use the Class-Path attribute of the manifest to define a relative path(s) to the other jar(s) that you need to use.
    [http://java.sun.com/docs/books/tutorial/deployment/jar/index.html]

  • Accessing classes in external jar files

    I have a jar file called main. I want it to be able to acces the classes in another jar file say test.jar how do i do this.
    Thank you

    ok, if i have this right...
    you have 2 directories that hold 2 .jars, right?
    plugins/ -------- build/plugins .jar
    systemModuals/ ------- DiaryUI and Loader .jar
    Your main JAR is diary?
    Diary.jar
    you want Diary to run with the jars inside plugins and systemmoduals?
    you set the "class-path:" tag like this....
    write this manifest file. save it as Manifest.txt and put it in your home dir.
    Main-Class: YourMainClass
    Class-Path: Diary.jar plugins/this.jar systemmoduals/diaryui.jar
    <make sure to hit enter, go to the next line>
    command line to your parent directory.
    jar cmf Manifest.txt Diary.jar build/main/*.class
    you should be set to go.
    use
    jar xf META-INF/MANIFEST.MF
    to read the present manifest that netbeans has created
    if necessary

  • Is it possible to load classes from a jar file

    Using ClassLoader is it possible to load the classes from a jar file?

    URL[] u = new URL[1] ;
    u[0] = new URL( "file://" + jarLocation + jarFileName + "/" );
    URLClassLoader jLoader = new URLClassLoader( u );
    Object clsName = jLoader.loadClass( clsList.elementAt(i).toString() ).newInstance();
    I get this error message.
    java.lang.ClassNotFoundException: ExceptionTestCase
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
    // "file://" + fileLocation + fileName + "/" This works fine from a browser.
    Is there anything I am missing? Thanks for the reply.

  • How to keep track of all the classes/methods/properties created in a long script

    Hi,
    I'm curious to know what method people use to keep track of all the classes, methods, and properties you've created when writing a longer script.
    For quick scripts, this isn't a problem. But for long scripts it can get quite difficult to keep track of all the objects one has created, and all their methods and properties, and overloaded constructors, etc.
    ESTK is great, and it's the IDE I use for InDesign scripting, if only because of it's powerful debugging options.
    But it doesn't provide any way of keeping track of this stuff. No proper Intellisense as in Visual Studio.
    I'd be interested to hear how people solve this issue.

    Hi Ariel,
    Not sure it is relevant to your question but I have an old snippet that collects and displays ExtendScript references using $.list(). This may help to track some object relationships.
    // WARNING: this is just a WIP -- Not tested in all platforms and versions
    $.scanRefs = function scanRefs(/*0|1*/showAll)
        var s = $.list(),
            p = (!showAll) && s.indexOf('[toplevel]'),
            a = ((!showAll) ? s.substr(0,10+p) : s).split(/[\r\n]+/),
            n = a.length,
            // --- Address:1     L:2  Rf:3   Pp:4  Type:5  Name:6
            re = /^([0-9a-z]{8}) (.) +(\d+) +(\d+) (.{10}) (.{1,17})/,
            reTrim = / +$/,
            i, t, k, m,
            refBy, type, name, tag, rest, rfCount, props, j,
            o = {},
            TYPES = {'Function':"FCT", 'Object':"OBJ", 'Array':"ARR", 'RegExp':"REG"};
        for( i=2, refBy=0 ; i < n ; ++i )
            s=a[i];
            while( s && m=s.match(re) )
                k = '&'+m[1].toUpperCase();
                rfCount = parseInt(m[4],10);
                rest = s.substr(m[0].length);
                type = m[5].replace(reTrim,'');
                name = m[6].replace(reTrim,'');
                if( 0x5B==rest.charCodeAt(0) )
                    p = rest.indexOf(']');
                    tag = rest.substr(0,1+p);
                    rest = rest.substr(1+p);
                else
                    tag = '';
                if( 0x20==rest.charCodeAt(0) )
                    rest=rest.substr(1);
                if( p=!(rest.indexOf("referenced by:")) )
                    rest = rest.substr(14);
                o[k] || (o[k] = {
                    locked:        +('L'==m[2]),
                    rfCount:    parseInt(m[3],10),
                    ppCount:    rfCount,
                    type:        TYPES[type]||type,
                    name:        name,
                    tag:        tag,
                    from:        [],
                    order:        -1,
                if( 0 < refBy )
                    if( p || !rest ){ throw "Unable to parse references." }
                    props = rest.split(' ');
                    refBy -= (j=props.length);
                    while( j-- ) t.from.push([k,props[j]]);
                    (props.length=0)||(props=null);
                    rest = '';
                else
                    refBy = rfCount;
                    if( p != !!refBy )
                        if( p ){ throw "Unable to parse references."; }
                        refBy = 0;
                    (t = o[k]).order = n - i;
                (m.length=0)||(m=null);
                s = rest;
        a.length=i=0;
        for( k in o )
            if( !o.hasOwnProperty(k) ) continue;
            a[i++] = k;
        a.sort( function(x,y){return o[x].order-o[y].order;} );
        //a.sort( function(x,y){return parseInt(x.substr(1),16)-parseInt(y.substr(1),16);} );
        var u,
            pngLock = "\x89PNG\r\n\x1A\n\x00\x00\x00\rIHDR\x00\x00\x00\x0E\x00\x00\x00\x0E\b\x06\x00\x00\x00\x1FH-\xD1\x00\x00\x00\tpHYs\x00\x00\x0B\x13\x00\x00\x0B\x13\x01\x00\x9A\x9C\x18\x00\x00\x01VIDAT(\xC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x00(\x96\xDD\xE3\x00\x00\x00\x03PLTE\x00\x00\x00\xA7z=\xDA\x00\x00\x00\x01tRNS\x00@\xE6\xD8f\x00\x00\x00\x15IDATx\xDA\xDD\xC1\x01\x01\x00\x00\x00\x80\x90\xFE\xAF\xF6#\xDA\x01\x00\xD2\x00\x01\xCC \x10\x14\x00\x00\x00\x00IEND\xAEB`\x82",
            w = new Window('dialog', " ExtendScript Memory"),
            p1 = w.add('panel', u, "References"),
            lRefs = p1.add('listbox', u, "",
                numberOfColumns: 4,
                showHeaders: true,
                columnTitles: ["Address", "Type", "Name", "Refs"],
                columnWidths: [90,60,120,36],
            g = w.add('group'),
            pFrom = g.add('panel', u, "From"),
            lFrom = pFrom.add('listbox', u, "",
                numberOfColumns: 4,
                showHeaders: true,
                columnTitles: ["Address", "Type", "Name", "Property"],
                columnWidths: [90,60,120, 120],
            pTo = g.add('panel', u, "To"),
            lTo = pTo.add('listbox', u, "",
                numberOfColumns: 4,
                showHeaders: true,
                columnTitles: ["Property", "Address", "Type", "Name"],
                columnWidths: [120,90,60, 120],
        g.orientation = 'column';
        w.orientation = 'row';
        w.alignChildren = ['left','top'];
        lRefs.maximumSize = lRefs.minimumSize = [330,450];
        lFrom.maximumSize = lFrom.minimumSize = [420,120];
        lTo.maximumSize = lTo.minimumSize = [420,220];
        lRefs.onChange = function()
            lFrom.removeAll();
            lTo.removeAll();
            lFrom.parent.text = "From";
            lTo.parent.text = "To";
            if( !this.selection ) return;
            var key = '&'+this.selection.text,
                t = o[key],
                from = t.from,
                i = from.length,
                k;
            lFrom.parent.text = "["+key.substr(1)+"] is reachable from " + t.ppCount + (1<t.ppCount ? " properties" : " property");
            if( t.ppCount && !i )
                with( lFrom.add('item', '--------') )
                    image = pngNop;
                    subItems[0].text = '';
                    subItems[1].text = '<UNKNOWN REFERRER>';
                    subItems[2].text = '';
            while( i-- )
                k = from[i][0];
                t = o[k];
                with( lFrom.add('item', k.substr(1)) )
                    image = t.locked ? pngLock : pngNop;
                    subItems[0].text = t.type;
                    subItems[1].text = t.name + ' ' + t.tag;
                    subItems[2].text = from[i][1];
            for( k in o )
                if( !o.hasOwnProperty(k) ) continue;
                t = o[k];
                from = o[k].from;
                i = from.length;
                while( i-- )
                    if( from[i][0]!=key ) continue;
                    with( lTo.add('item', from[i][1]) )
                        image = pngNop;
                        subItems[0].text = k.substr(1);
                        subItems[1].text = t.type;
                        subItems[2].text = t.name + ' ' + t.tag;
            lTo.parent.text = "["+key.substr(1)+"]'s properties had access to " + lTo.items.length + " addr.";
            from = t = null;
        for( i=0, n=a.length ; i < n ; ++i )
            t = o[k=a[i]];
            with( lRefs.add('item', k.substr(1)) )
                image = t.locked ? pngLock : pngNop;
                subItems[0].text = t.type;
                subItems[1].text = t.name + ' ' + t.tag;
                subItems[2].text = t.ppCount + '/' + t.rfCount;
        w.show ();
    // TEST
    var t;
    var f = function MyFunc()
        (function MyInnerFunc(){})();
    $.scanRefs(1);
    @+
    Marc

  • I am moving to Alice Springs, Australia, this summer from the U.S. I would like to get the new iPad. How can I found out if I will be able to access all the functionality in Alice? Will I need to purchase a local plan of some sort?

    I am moving to Alice Springs, Australia, this summer from the U.S. I would like to get the new iPad to use while traveling back and forth from the U.S. to Australia, and within Australia. How can I found out if I will be able to access all the functionality of the iPad in Alice? Will I need to purchase a local plan of some sort? I have never owned an Apple product before -- I'm a newby!

    Aside form the limitation of LTE to the 700MHz and 2.1GHz bands (which rules out LTE in Europe I gather, at least as it stands now) the new iPad should let you use a GSM 3g/2g/edge network anywhere.  The CDMA Verizon model will only be able to use it's native CDMA radio band in the USA (that radio will be locked to Verizon), but it's international GSM radio is the same as the AT&T model.
    Keep in mind though that by far the cheapest option when abroad is to take advantage of free wifi as much as possible (well, that is always the cheapest option, since it is free).  I know several people who have taken their wifi-only iPads and iPad2s to Europe and said they did not find the lack of 3G really inconvenient at all as most towns had plenty of free or cheap wifi access all over the place.
    And in 3 years, your iPad will be at least 2-3 generations behind, LTE will have already been replaced by 5G or whatever the next new generation of cellular ends up being named (and the "young" kids will be wondering what the heck 3G even means or meant - dang that stuff was from the olden days!), and you can pitch that ancient piece of technology and start things all over again 

  • How can i access all the objects of one schema from another schema

    Dear All,
    How can i access all the objects(Tables,Views,Triggers,Procedures,Functions,Packages etc..) and do the modifications of one schema from another schema (Without using synonyms concept).
    Thanks in advance,
    Mahi

    First of all, synonyms only help you easy reference the object. It doesn't have any implication of object privilege.
    As long as you have proper privilege on target object. You can access it with or without synonyms.
    Assuming you have proper privilege of objects, you can use following command to assume schema owner.
    ALTER SESSION SET CURRENT_SCHEMA = Schema_owner

Maybe you are looking for

  • PLEASE HELP Itunes wont open after downloading v6

    COMPAQ Presario R3000   Windows XP   Please help, i have just downloaded itunes (v6) and when i try to open it, nothing happens (no error) it is in processes in task manager (as itunes.exe) but it is not actually open. I have spent many hours trying

  • Is it safe to re-install vm server - need help all envs down

    i raised another query about this but had no replies - I have also raised 2 SR's to know avail yet please help if you can: I added extra cpu's and mem to a vm server (the only one in a pool) - now nothing works if i try to rediscover the server it sa

  • How to include a large amount of objects in a package interface

    Hi guys, I would like to include a large amount of objects (programs, classes, etc.) in a package interface in the package builder (SE21). I would like to avoid inserting them one by one. Is anyone have a solution? It is not possible to use such char

  • Automated email to client

    dear all, we have a requirement ... the requirement is about financial department. we have received post dated cheque from client , let say '10-apr-10'. and we want to inform to particular client before 7 days that their cheque date is coming please

  • EDI 820 mapping into SAP

    Hi Can any one give me the step-by-step approach in mapping the EDI 820 (both Inbound steps and Outbound steps) into SAP standard functionality ? Thanks Maruthi Ram