Basic jar file usage question

I have developed a java project in eclipse. To develop this, I have used many external jars that I added in Java Build Path.
I exported this project as jar file.
Now I want to use class files in this project in the jsp page.
The problem is where should I put my jar file of this project and also the external jar files that I used. I made a WEB-INF folder in my project folder but still it is creating errors.
Please suggest.

HI,
I put both my project jar file, and the external jar file on which it is dependent in WEB-INF/lib directory. It can find my project jar file but not the external jars(axis.jar) and gives the errors as:
java.lang.NoSuchMethodError: org.apache.axis.description.ParameterDesc.setItemQName(Ljavax/xml/namespace/QName;)V
Could you please tell what is the problem. Under which path it looks for the external jars?
Edited by: Popup on May 15, 2008 8:18 AM

Similar Messages

  • What are the basic .jar files to be set in web dynpro project classpath

    Hi,
    I am having a problem while customizing the ESS. I used DTR, DC and imported configuration. After that, I created project from one of the DC(say ess/jp/addr). Later when I open an iView from any Web Dynpro component, I am getting lot of errors without even making any modifications.
    I closed the project and reopened it and reload & rebuilt, but it doesn't solved my problem. In my classpath settings I couldn't find any jar files except the jre_lib. Could you please let me know what are the basic jar files we have to set in classpath and where to get them from. We are using NWDS 7.0.06 version.
    Can you please let me know how to solve this or any other way to work around this.
    It's an urgent to be fixed as early as possible, plz help me out.
    Thanks & Regards,
    Raj

    Hi Julien,
    Thanks for your reply.
    We imported the the specified SCAs in our track.
    we are getting the following errors.
    Kind Status Priority Description Resource In Folder Location
    Error The import com.sap.xss.per cannot be resolved CcPerAddressInterface.java NS1_XSSTR_Dessusaddrsap.com/gen_wdp/packages/com/sap/xss/hr/per/us/address/cc line 18
    Error com.sap.pcuigp cannot be resolved (or is not a valid type) for the argument fpm of the method loadConfiguration CcPerAddressInterface.java NS1_XSSTR_Dessusaddrsap.com/gen_wdp/packages/com/sap/xss/hr/per/us/address/cc line 113
    Error com.sap.pcuigp cannot be resolved (or is not a valid return type) for the method getNextPerspective CcPerAddressInterface.java NS1_XSSTR_Dessusaddrsap.com/gen_wdp/packages/com/sap/xss/hr/per/us/address/cc line 127
    Error com.sap.pcuigp cannot be resolved (or is not a valid type) for the argument currentPerspective of the method getNextPerspective CcPerAddressInterface.java NS1_XSSTR_Dessusaddrsap.com/gen_wdp/packages/com/sap/xss/hr/per/us/address/cc line 127
    Error com.sap.pcuigp cannot be resolved (or is not a valid return type) for the method getCAPState CcPerAddressInterface.java NS1_XSSTR_Dessusaddrsap.com/gen_wdp/packages/com/sap/xss/hr/per/us/address/cc line 137
    Error com.sap.pcuigp cannot be resolved (or is not a valid type) for the argument perspective of the method getCAPState CcPerAddressInterface.java NS1_XSSTR_Dessusaddrsap.com/gen_wdp/packages/com/sap/xss/hr/per/us/address/cc line 137
    we manually set below .jar files in classpath settings.
    pcuixssfpm.jar
    pcuixssutils.jar
    logging.jar
    essper.jar
    Is there any alternative to work around.
    Thanks & Regards,
    Raj

  • Jar file upload and transport in Java webdynpro

    Hi,
    I wanted to change do small chnage to the existing jar file in webdynpro jave application. I did change the jar file.
    Question: Please let me know how can i include this jar file into existing application back and how the transport happend for the same?
    do we need to copy paste the ne jar file(updated jar file) in local drive where it exists and do little chnage the application will create an activity. then move to test and prd  will that move the jar file as well?
    appreciate your prompt help.
    Thanks
    Rag

    hi rag,
    1) "Like this have couple projects for same application. Under two are Jars, under these two jars i have to update my changed jar. Then the file used in another project.
    I can see other project which is using this jar is seeing in webdynpro explorer.
    But two jar projects are not showing in webdynpro explorer, but they can see through Navigator after i imported into location NWDS."
    here it shows that two are external library files having the jar file in the library folder.
    2) "My request is i have changed the jar file from existing jar project and replaced it in local path where it is currently. but it didnt ask me the activity to deploy the same.
    In this part , im not clear like how you were able to change the jar file without checking out the external lib dc , in the external lib, as i told earlier if it was checked out then activity will not be asked,
    3) "so how do i update JAR file and delpoy into server. and where can i see the JAR file been updated in server? i am how to deploy into server."
    JAR file cannot be deployed directly the way you deploy a DC or Webdyn pro project.
    if you have changed the jar file , just build your webdynpro project that uses this jar file. and deploy the same . The new jar file gets deployed along with your webdynpro project.
    if you want to deploy jar file, then you have to create a wedynpro development component of type j2EE-Server--library .
    Then in Used Dcs add your external lib dcs assembly public part with build time dependency
    go throught this blog you will know more about external jar file and its usage at run time.... and how it is getting deployed to the server.
    https://scn.sap.com/people/bertram.ganz/blog/2008/11/24/how-to-use-external-jar-files-in-web-dynpro-development-components

  • Cant use jar file - JAVA -

    - JAVA -
    Basically I have few files in one package in every one of them I worte:
    "pack preyPackage;"
    And I have some .jar file that I try to use. So I drag it into the oracle compiler, but I still couldnt use it. But if I delete the row:
    "pack preyPackage;"
    from each .java I able to use that .jar file.
    my question is how can I still use that .jar file and package's all that other files..
    Picture that shows the problem:
    http://hwzone.co.il/community/index.php?action=dlattach;topic=290416.0;attach=92107;image
    Thanks.

    Tried it and get strange behaviours in JDev 10.1.3.3...
    The latest version with sources can be found at
    http://stwww.weizmann.ac.il/G-CS/BENARI/oop/index.html
    You should get that one and modify the sources to include a package name.
    I have little time to do that because I'm going on holiday for a week...
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Mak a jar file

    hello,
    i've been working with java and java servlet for a while, but i've no clue about jar files. my question is, how do i make a jar file? is a jar file a compressed version of multiple class files or what? thanks for any advice.

    OK, here's a link to learning about JAR files - this should help you master all you'd need to know to work with jars.
    http://developer.java.sun.com/developer/Books/javaprogramming/JAR/basics/
    Rather than provide you with a brief explanation here, i guess visiting the link and learning all thats there would be more helpful.
    Hope the above helps.
    John Morrison

  • JAR file does not get uploaded to client for my SERVLET generated APPLET

    Some help please...
    I have a servlet that generates the HTML code that contains an APPLET. This APPLET needs a JAR file that is listed under its ARCHIVE property. The SERVLET is in a JAR file that is in the same directory as the other needed JAR file. If I create a static HTML with the output of the SERVLET it works fine. But if go through Weblogic the needed JAR file does not get uploaded to the client so I get a java.lang.NoClassDefFoundError:and my APPLET does not load.
    Q1: I am not sure what to put under the CODEBASE tag. I tried "." and I also tried "http://mymachine" but both did not work. I also tried without the CODEBASE tag. No luck. The SERVLET is bound to http://mymachine/servlet.
    Q2: Does anyone have any suggestions on how to do this? Is there a way to force the browser to upload a certain JAR file?
    Thanks...

    It works!!
    This is what I did:
    The jar file in question was the weblogic.jar. I tried putting it under the lib directory of my war file but I had problems because the weblogic.jar contains other war files inside so when I tried to deploy my war file it also tried to deploy the inner war files which for some reason did not work. So I tried removing the war files from the weblogic.jar and this time I had no problems deploying my war file but I still could not find the classes I needed. So I tried moving the weblogic.jar to the root dir of my war file and it worked!! Now the trick here was: I did not set the CODEBASE AND I had the ARCHIVE paramenter set in TWO places like below:
    <APPLET CODE = "marketmap.client.MarketMapApplet"
    ARCHIVE = "weblogic.jar"
    WIDTH = "657"
    HEIGHT = "382"
    ALIGN = "BOTTOM"
    ALT = "APPLET tag not recognized">
    </XMP>
    <PARAM NAME = CODE VALUE = "MyApplet" >
    <PARAM NAME = "type" VALUE="application/x-java-applet;version=1.2.2">
    <PARAM NAME = "scriptable" VALUE="false">
    <PARAM NAME = ARCHIVE VALUE="weblogic.jar">
    </APPLET>
    Actually if you do not place a parameter named ARCHIVE (at the end) it wil NOT work. I tried with multiple jar files listed and it works great too.
    Anyway I figure I'd share. Thanks for the help too.
    Lastly for people who choose not to upload the jar files to clients, you should look at the bea documentation on applets. It lists a classpath servlet that allows you to provide classes to the clients without having to force them to download the jar file.

  • How to append existed jar file?

    do existed jar file be append again?
    example:
    a.jar // existed jar file
    xyz // forlder that want append to a.jar

    you mean you want to add a directory full of class files to the existing .jar file?
    check the .jar file usage options.
    c:\> jar -helpDiablo

  • Basic JAR Question

    Hello,
    I hate to ask such a simple question, but I'd like to get confirmation from people who know.
    It is possible to package non-EJBs into a deployed JAR containing EJBs, isn't it? I have heard that you cannot mix a non-EJB class into a JAR that contains EJBs, but my interpretation of the literature I've found about packaging EJBs seems to indicate otherwise.
    Basically, it looks like you would want to (or need to in some cases) package any class that an EJB depends upon through inheritance or through another association (e.g. a custom user Exception class that and EJB might throw) into the same JAR file.
    Please reply and set me straight on this. Thanks in advance.
    Jeff

    1. You can include any classes in your EJB jar file, and it is widely used. You can also include other files (e.g. properties) and access them through the class loader (as resources).
    2. If you use some libraries, you may reference them with Class-Path: element in your manifest file. It is not necessary to unpack the library and include its classes in your jar file. (About "Class-Path" -- look page about manifest in the java tutorial (in the JAR files trail)).
    3. Your JAR can contain no classes, just a deployment descriptor, if your classes are somewhere and you have referenced them with "Class-Path". ;)

  • Question about using third party jar files in Java Web Start Environment

    Hi everybody, I got a very strange problem and still can't figer out how to solve it. Can anyone help to overcome this problem?? Thanks in advance.
    Question: I wrote a simple java swing application to connect to Oracle database. I packed whole my classes and a third party jar file(classes12.jar) to a new jar file named "IRMASSvrMgntGUI.jar" and then use command 'jarsigner' to signed IRMASSvrMgntGUI.jar. There is no problem when I execute 'java -jar IRMASSvrMgntGUI.jar' in the command line. But when I execute this application via Web Start Environment, an "java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
    " error occured with the following detail log shown in Jave Web Start Console:
    =============================================================
    java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
         at DBConnection.getNewConnection(DBConnection.java:25)
         at IRMASSvrMgntGUI.actionPerformed(IRMASSvrMgntGUI.java:524)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.AbstractButton.doClick(Unknown Source)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
         at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    ==========================================================================
    contents of the manifest file I used to create this jar file are as follows
    ===================================
    Manifest-Version: 1.0
    Main-Class: IRMASSvrMgntGUI
    Class-Path: classes12.jar
    Created-By: 0.9a (itoh)
    ===================================
    and file structures in "IRMASSvrMgntGUI.jar" is
    ====================================
    META-INF/
    classes12.jar
    DBAuthenticateDialog.class
    DBConnection.class
    IRMASSvrMgntGUI.class
    ====================================

    If you directly include classes12.jar in IRMASSvrMgntGUI.jar, the classloader won't be able to find the classes inside classes12.jar. You should sign classes12.jar separately and include that in jnlp along with your application specific jar. When you're launching your app using "java -jar somefile.jar" then the classpath settings in manifest file are used, but that's not the case when you start using JWS since in this case the classpath is based only on the " <jar href=..." entries in jnlp.

  • Quick Question **PLEASE HELP** .jar file?

    Hey everyone, im pretty new to the java scene but I have a really quick question that hopefully someone can help me with.
    I'm really interested in making a .jar file out of my code. And basically I just want to make one. but i understand there are certain things like main class's, etc. that need to be made in order to make a .jar file.
    So basically Say I opened up a new project in blueJ. I made 1 new class called "main." Inside of it I had nothing for conductors and no variables declaired untill the bottom part where i write my code.
    say i write...
    System.out.println("hello");
    and that is it.
    What steps from there do i do to make a jar file and have it be able to be executed and SEE the "hello" printed somewhere NOT in blueJ??
    (I understand there is something about a "static" method? Im not really sure but if somoene could enlighten me on how to make a .jar file that would be great.)
    Thanks a lot everyone!
    Tom

    I don't know anything about BlueJ, but this section of Sun's tutorial explains how to
    write a program that outputs a single line of text to the console:
    http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html
    Deploying an application as an executable .jar file is covered here:
    http://java.sun.com/docs/books/tutorial/deployment/jar/index.html
    The first two sections - "Using JAR Files: The Basics" and "Working with Manifest
    Files: The Basics" - contain the information you need to understand this process.

  • Classpath and jar file question

    my application need to use few jar files i downloaded from the internet
    so i need to set the classpath so that i can import the packages in the jar file rite?
    let say set classpath=.;c:\somedir\bin;
    the ".;" after the "=" means that i search the current directory first then search the directory i have specified after that rite?
    if so, can i put all the needed jar files in the current directory so that my application can use them??
    Another question is if all the jar files in located in the same directory how can i set the class path to refer to them without sepecifying each of the jar file name??can i just put the directory path and will it locate them automatically when my application start??
    can anyone tell me about it??thanks

    No, you need to include each and every jar file in your classpath.
    Or put them all in your <jdk_installation_dir>\jre\lib\ext directory, so that they will get included in your classpath automatically.
    Sudha

  • Question about Java Applet Jar file signing.

    These questions pertain to Java 6 Standard Edition 1.6.0_22-b04 and later.
    I have gone through the Oracle Java Tutorial for generate public and private key information
    to sign a jar file, and how to sign the jar itself, all at
    [http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html|http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html]
    , and seek some clarification on the following related questions:
    -In order to "escape" the java applet sandbox that exists around the client's
    copy of the applet running in their web browser, ie.
    (something forbidden by default), is verification of the signed applet enough, or is a policy file required
    to stipulate these details?
    -using the policytool policy file generator, what do I need to add under "Principals"
    (if anything) when dealing with a Java applet? Are Codebase and SignedBy simply author information?
    -If I choose to use a java.security.Permission subclass object set up in equivalent fashion within the Applet,
    which class within the Applet jar do I instantiate that object in? Does it need to be mentioned
    in the applet's jar Manifest.MF file?
    -Is the "keystore database" a java language service/process which runs in
    the Server's memory and is simply accessed and started by default
    by the client verifier program (appletview/web browser)?
    -The public key certificate file (*.cer) is put in the webserver directory holding
    the Applet jar file (ie. Apache Tomcat, for example).
    -Presumably, the web browser detects the signed jar
    and certificate file, and provides the browser pop up menu asking the user
    about a new, non recognised certificate (initially).
    Is this so?
    -With this being the case, can the applet now escape
    the sandbox, be it with or without the stipulated
    policy permissions?

    848439 wrote:
    -In order to "escape" the java applet sandbox that exists around the client's
    copy of the applet running in their web browser, ie.
    (something forbidden by default), is verification of the signed applet enough, or is a policy file required
    to stipulate these details?Just sign the applet, the policy file is not necessary.
    -Is the "keystore database" a java language service/process which runs in
    the Server's memory and is simply accessed and started by default
    by the client verifier program (appletview/web browser)?No.
    -The public key certificate file (*.cer) is put in the webserver directory holding
    the Applet jar file (ie. Apache Tomcat, for example).No. For a signed Jar, all the information is contained inside the Jar.
    -Presumably, the web browser detects the signed jar
    and certificate file, and provides the browser pop up menu asking the user
    about a new, non recognised certificate (initially).
    Is this so?No. It is the JVM that determines when to pop the confirmation dialog.
    -With this being the case, can the applet now escape
    the sandbox, ..Assuming the end-user OK's the trust prompt, yes.
    ..be it with or without the stipulated
    policy permissions?Huh?

  • Question about classpath and jar file

    I have a jar file (actually jhall.jar, the java help jar file). How do I uses its classes if I don't want to add it to the classpath. Currently, I have the jar file in the same directory as all my other classes.

    it simply adds secondjar.jar into firstjar.jar, rather
    than extracting secondjar.jar's files and put it into
    firstjar.jar. How would I be able to do that?Don't do either of them. Distribute the two jar files separately, and in the manifest of the one which is meant to be your executable jar file, put a Class-Path: entry that refers to the other one. Look at the latter parts of the tutorial about jar files:
    http://java.sun.com/docs/books/tutorial/jar/basics/
    PC&#178;

  • Three questions about signed jar file and applet

    I use three signed jar file. Each of them signed by different certificate. First of JARs contain applet class. When I start applet from html page I see message &#8220;This applet was signed by&#8230;&#8230; but Java cannot verify it&#8230; Do you trust&#8230;?&#8221;. All times I press &#8220;Yes I trust&#8221; and after this questions applet stop to work end exit. If I use only one certificate for signing of three JARs then applet continue to work after question. 1) What should I do to fix this bug? 2) Is it any method to check from applet that user press Trust button? Is it any method to emulate work of SecurityManager to check that Certificate object is trusted (I want do call some method check(Certificate) and if certificate is not trusted I want to see message with question: &#8220;Do you want to trust this certificate&#8221; and so on)?

    Hello Jarman,
    1. If I have a signed jar file, then as long as the
    certificate is recognised as trusted that applet can
    run as a fully trusted application on the client
    machine. So I should not have to add lines such as
    permission java.lang.RuntimePermission
    "readFileDescriptor", "read" ;
    permission java.lang.RuntimePermission
    "writeFileDescriptor", "write" ;
    to my java.policy file. true/false ?true
    2. If I am running a signed jar file in the Java
    plugin then I do not need to have a verisign or thawte
    certificate (however to allow my certificate to be
    accepted I do have to import it into the cacerts file
    on the client machine). True/false?true
    3. Following on from question 2, if I want to be able
    to run an applet on a client machine, without messing
    around with ANY files on those machines, I need a
    verisign or thawte certificate. True/false?true
    4. (And finally) Apart from a security exception
    saying that I need to add one of the lines like those
    of question 1, is there any way I can get other debug
    information as to why the signed jar file is not being
    recognised as signed?No. This could be a problem of importing your certifcate into the wrong place.
    The information on the following link is a little bit dated but it helped me to successfully install a testcertificate and sign an applet with it.
    http://www.suitable.com/Doc_CodeSigning.shtml

  • Help with a question about making/running .jar files.

    First i have a question, can i make a .jar file that can run on a computer without JRE installed. And if i can, how do i make it. I have tried to make it on my computer, that has JRE but i keep getting the error when i run it: Exception in thread "main" java.lang.NoClassDefFoundError: Sample\FileSearchAnd im using the command:
    jar cvfm jarname.jar directory\manifest.txt directory\FileSearch.class directory\FileNode.classIt says it creates the .jar but is unable to run it.

    dford425 wrote:
    First i have a question, can i make a .jar file that can run on a computer without JRE installed. No, not unless you package the JRE with your dist. Hence the name JRE (Java Runtime Environment).
    And if i can, how do i make it. I have tried to make it on my computer, that has JRE but i keep getting the error when i run it: Exception in thread "main" java.lang.NoClassDefFoundError: Sample\FileSearch
    That simply means your not pointing the runtime to the classes. Set your CLASSPATH environment variable correctly and it will run (given you have a JRE which it appears you do).
    And im using the command:
    jar cvfm jarname.jar directory\manifest.txt directory\FileSearch.class directory\FileNode.classIt says it creates the .jar but is unable to run it.

Maybe you are looking for