Declare external jars in the manifest in a EAR file

Hi all,
I'm using weblogic 7.0, I build a web service from a java class. So here is the ear file :
- myWebservice.ear - META-INF - application.xml
- myWebservice.ear - META-INF - MANIFEST.MF
- myWebservice.ear - web-services.war - META-INF - MANIFEST.MF
- myWebservice.ear - web-services.war - WEB-INF - classes - ...
- myWebservice.ear - web-services.war - WEB-INF - web-services.xml
- myWebservice.ear - web-services.war - WEB-INF - web.xml
- myWebservice.ear - web-services.war - myWebserviceClient.jar
I hope I'm clear... :)
Actually, I would like to add in the 2nd manifest.mf something like :
Class-Path: ../lib/myTools.jar
myTools.jar is not in the ear file, it is just a relative path.
Can someone tell me is it is possible ? If so, how to do so?
I will appreciate any advice :)
Regards.

No, that doesn't work in J2EE 1.3.
The typical approach would be to include the jar file within the EAR and then in the WAR file, specify a manifest class-path.
If you were using WLS 9.x, then it would be possible to deploy the jar file separately as a library or optional package, but this is not available in 7.0
-- Rob
WLS Blog http://dev2dev.bea.com/blog/rwoollen/

Similar Messages

  • How to add external jars in the configuration of JSmooth?

    Hello,
    I am trying to create an exe file from a java program using JSmooth.
    The program is a simple hello world proogram.
    I am developing under eclipse, and I am using some external jar files as libraries.
    If my program is simple,; it works fine. If I add an import of a class that is in one of these jar files, I get the following error when executing the created .exe file:
    "Could not find the main class. Program will exit".
    I guess I have to add this Jar file to the path for the creation of the .exe file.
    My question is: does anybody know HOW to add an external jar in the configuration of JSmooth for the creation of an exe file from a Java program?
    Thanks for your help
    Philippe

    i have the same problem phsans
    you know the answers??
    thanks phsans:D

  • HT1751 when one copies their itunes library to an external device, does the iPad apps and other files get copied also?

    When copying iTunes files to an external device, do the Apps and other files for an iPad get copied also?

    If the instructions are followed and the ENTIRE iTunes folder is copied, then all the contents of the folder (including apps) will be copied.

  • How do I specify utility jars that my application needs in EAR file

    I'm using weblogic 7.0 and trying to deploy and application. I would like to add
    any utility classes related to this application with in the .ear file and deploy
    the application. Where should I add these files. Does APP-INF/lib work with 7.0?
    Please suggest some sol...
    Thanks

    You'll need to use manifest class-path entries in 7.0. It's covered in
    the J2EE spec, or if you search this newsgroup, you should see plenty of
    examples.
    -- Rob
    Jaya wrote:
    I'm using weblogic 7.0 and trying to deploy and application. I would like to add
    any utility classes related to this application with in the .ear file and deploy
    the application. Where should I add these files. Does APP-INF/lib work with 7.0?
    Please suggest some sol...
    Thanks

  • Refer external Jars

    Hi All,
    Is there a way in which one could refer to external jars through the manifest of a jar file. For example, i have the following directory structure:-
    product
    |
    |- bin
    | |
    | |- myproduct.jar
    |
    |- lib
    | |
    | |- resource1.jar
    | |- resource2.jar
    Now, is it possible to set the resource1.jar and resource2.jar in the classpath of myproduct.jar so that myproduct.jar can use the classes in these jar files?
    For your information, myproduct.jar is an executable jar, which has a main class attribute defined in its manifest file.
    Thanks a lot in advance,
    Regards,
    Dev.

    I have the same problem, I think, but your solution did not work.
    I have a directory structure:
    java/com/bti/acecomm/syslogwatch
    I have my classes in syslogwatch and mail.jar and activation.jar in java directory.
    I went into the java directory and ran jar -cvmf SyslogWatch.mf syslogwatch.jar com
    The manifest has:
    Main-Class: com.bti.acecomm.syslogwatch.SyslogWatch
    Class-Path: activation.jar;mail.jar
    I complains:
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/MessagingException
    at com.bti.acecomm.syslogwatch.SyslogWatch.main(SyslogWatch.java:95)
    javax/mail is in mail.jar.
    I am not sure what I am doing wrong.
    David

  • Session EJB with external jar dependacy problem

    I have a Session EJB that I am having trouble adding to my Creator 2 project. The session bean is developed with netbeans 5.0, ejb2.1, for sjsas 8.2 PE. It has one external jar which is compiled into the ejb jar. When I try to add the session bean to my creator 2 project I get a java.lang.reflect.UndeclaredThrowableException. Creator 2 is not finding one of the Exception external jar.
    The only way I have been successful in added the session EJB is also add the external jar. But the project fails when you load the page with javax.naming.NameNotFoundException: No object bound to the name java: xxxxxx I believe the EJB is failing at instantiation.
    Has anyone had this problem and overcome it?
    Thanks,
    Francis

    Finally I found solution.
    Instead of deploying ejb jar to ear I've created a new ear deployment profile (so now I have ejb jar profile and ear profile).
    It contains ejb jar + external jar library and custom manifest.mf with class-path to ext. jar.
    Difference between this and previous version is the old one ear cointained ejb jar and the ejb jar contained ext. jar.
    Now ear contains both ejb jar and ext. jar.
    Rado

  • Do I need toload external jars

    Hi All,
    I am using hssf API (org.apache.poi.hssf.usermodel.HSSF) which is nothing but API for writing into Excel sheet.
    I have created a jar file using Eclipse when I run the same jar file from command prompt I get the error
    C:\New Folder>java -jar TextToXls.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/poi/hssf/
    sermodel/HSSFWorkbook
    at JavaTxtXls.<init>(JavaTxtXls.java:14)
    at JavaTxtXls.main(JavaTxtXls.java:34)
    I guess its not able to load jar files associated with HSSF ..so can anyone please tell me how to rectify it..
    I mean to say how do we add external jars with the jar which we wish to execute by double click..
    One of my friend asked me to create a batch File and set classpath during runtime and then call the java file..any better solutions..

    You have to add the relative path to your external jar in your manifest.
    For example, when you create a jar file, it has a META-INF folder. Inside this folder, you will find a manifest.MF file. Open it with a text editor and it should look like:
    Manifest-Version: 1.0
    Main-Class: YourMainClass
    Then, you add a new line to show where is your external jar:
    Manifest-Version: 1.0
    Main-Class: YourMainClass
    Class-Path: externalLibrary.jar
    Note that in this case, your external jar should be in the same directory as your jar application.

  • Getting error while calling external Jars in BPEL by using Java embedding activity in soa 12c

    Hi,
    I am trying to use an external Jars for the business logic implementation. Here I need to pass XML as input and
    and I expect the "Password " field has to be return.
    Following are the steps I have followed:
    1) Created a java project with sample class and added the external jars into the project "Libraries &Classpath".
    2) Created a jar file out of it.
    3) Created a BPEL project with Java Embedding.
    4)Wrote the java code in java embedding activity.
    4) Added the above created jar file to the BPEL project's lib/jar  and added in SCA-INF/lib project folder as well.
    5) Imported the package with the class as in the jar (e.g <bpelx:exec
    import="pkg.testInterface"/>)
    6) Deploy the BPEL project.
    while deploying the SOA build is sucessful but my depoyment is incomplete.
    error:
    advices will be great....
    Regards,
    Dilip

    Hi,
    Can you confirm if the BPEL Version is 1.1 or 2.0.
    If you are using BPEL 2.0 you need to import the required jar/class file as:
    <import importtype="http://schemas.oracle.com/bpel/extension/java" location="pkg.testInterface"/>
    For BPEL 1.1 the syntax to import other jar/class file is:
    <bpelx:exec import="pkg.testInterface"/>
    If you import the classes in the correct format you will not face any deployment error.

  • Including External JARs for Java Application in OC4J

    Hi Experts,
    Here is my requirement.
    I have developed my Java application using Tomcat Server & Eclipse. In my application I have used some External JARs & imported the classes in my JSP.
    Now that I'm using OC4J Server instead of Tomcat I'v no clue as to where I have copy these External JARs for my application to work.
    I have installed OBIEE-Client which includes OC4J server. The path where I have placed my application is as below
    *"C:\OracleBI\oc4j_bi\j2ee\home\default-web-app"*
    If I run my application the server does not import the classes in the JSP which we include using Import statement using JSP tags (*ex* - <%@ page import = "org.apache.commons.fileupload.*"%>).
    This is the location which I found, where I need to put my Java-J2EE application. This OC4J_BI comes with OBIEE.
    Kindly help me out on where to place these External JARs exact location in OC4J.
    Also let me know if I have to alter any configuration/xml file (if so pls specify the file name & its location).
    Thanks in advance,
    Venky

    You can either include the external libraries in the application, by placing them into WEB-INF/lib, or you can import them into the server as "shared libraries", normally you'd use the "enterprise manager" application to do this. Having loaded a shared library you then add it to the classpath when you're deploying the application.

  • How to include external jars - URGENT...

    Hi:
    I am using Eclipse for development.
    My application uses some external jars.
    This step is simple in Eclipse, one simply indicates where the jars are to the IDE.
    However, when I make an executable JAR file from my project, those external JARs are not included.
    So when I run my program, everything is fine until the parts that uses the external JARs.
    Does anyone know how to include them outside of Eclipse platform?
    I am going to see my client in an hour and of course I can't bring my source and install an Eclipse at my client's computer to show them my demo...
    please help... thanx...

    You add those external jars to the classpath or the jars classpath if you're running the program from a jar. Or put the external jar to JAVA_HOME\lib\ext (IIRC)

  • Classes not found for jars listed in manifest

    I have an applet whose main jar has a number of dependent jars listed in the manifest. All the jars are signed.
    The applet works fine when downloaded from an HTTP server.
    Previous to 1.6.14 it would also run from a local directory.
    As of Java 1.6.15 and 1.6.16, the classes in the dependent jars are no longer loadable from the local directory. ClassDefNotFound is the reported on the java console. Obviously the class is present, as the application is running fine in JVMs 1.6.14 and previous.
    I see that 1.6.16 includes changes for the security baseline, but I cannot find anything that suggests changes are needed to support dependent jars. None of the dependent jars request a specific version of JRE.
    Anybody know what is going on?

    Is this the error? ...Yes, sorry, the exception is NoClassDefFoundError
    If you provide a Short, Self Contained, Correct Example someone may be able to diagnosis the problem, as opposeed to guessing. A link to the real live application can be found at: http://download.equitrac.com/38834/InstallGUI.html. (This original application does not meet the definition of short ... but demonstrates the problem well.)
    When run as an applet off this site, it works fine.
    If you click on the download button, it will place a copy on your local harddrive. To execute it locally double click on your local copy of InstallGUI.html.
    When running it locally with Java 1.6.15 and 1.6.16 it will give you a class def not found exception without doing any thing.
    When running locally with Java 1.6.14, it will not experience any trouble.
    This applet needs permissions to open sockets and store data on the harddrive.
    Probably due to the presence of class files that once existed outside of the jars, but are now not thereClose ... the application is made up of a main jar (our product) and a number of third party jars. The manifest for the main jar properly references the other jars, and works in all JVMs before 1.6.15. As of 1.6.15, none of the classes from the referenced jars can be opened.
    I found that I can work around the problem by placing all classes into a single jar ... which may infringe on licensing requirements for some of the third party jars we use.
    Dave

  • External JARs in .jnlp

    Hi,
    I have got a swing application.
    I need include tablelayout.jar in the class path.
    How can I do this using .jnlp file?
    Right now I can see the class not found exception in the console. I included the jar in /devlib folder under ROOT of Tomcat6.
    When I started the application it is showing un registered entry message for devlib/tablelayout.jar
    Please suggest how include the tablelayout.jar in the class path using .jnlp file
    what is the reason for registration exception. Do we need to perform registry for each and every extenal jars we need to include?
    Please help...

    See http://help.sap.com/saphelp_nwce10/helpdata/en/d7/fc139ba1549047a5372ad3c0d540ea/frameset.htm
    under "External library".
    Armin

  • How to use external jars in NW2004

    Hello Experts,
    can i use the same approach mentioned in the below Weblog for using the external jars in NW2004.
    /people/bertram.ganz/blog/2008/11/24/how-to-use-external-jar-files-in-web-dynpro-development-components
    and if not then what will be the best way to achieve it in  NW2004.
    Please provide your inputs on above.
    Regards,
    Siddharth

    Hi Sidharth,
    If you are using web dynpro DC perspective then you need to follow the following points to use the external jar files in it.
    1. Create a external library project.
    2. copy the external jars in the library folder os the projects.
    3.) Select all the jars from the u201CLibrariesu201D folder, Right click and then select Development Component and click on Add to Public Part
    4.Select the first Radio Button (Provides an API)and give some nameto it.
    5. Repeat the step no 3 but now select the second radio button other than as selected in step no 4.
    6. Now build your lirary DC.
    7. Now create a j2ee DC project.
    8. ) Expand the node DC Definition and Right Click on Used DC. Select Add Used DC.
    9. Select the External Library DC with build time dependency.
    10.Right click on the J2EE DC and then select Development Component followed by Build
    11. Right click on the J2EE DC and then select Development Component followed by Deploy
    now you can use both the libary DC and the j2ee DC in your web dynpro DC as used DC.
    But if you have created a web dynpro project only(but not DC) than you can directly add the external jars in java build path
    hope this will help
    regards
    Narendra
    Edited by: Narendra Singh on Oct 27, 2009 11:22 AM

  • Problems regarding the manifest file in deploying an ear file

    I have developed one jar file(classes.jar) for my all my classes built.
    I have now one ejb module jar file which refers to my classes.jar throgh the mainfest.mf file of ejbmodule.jar file.
    I have one war file(web pplication) which also refers to my classes.jar file throgh its manifest.mf file.
    I am now making an ear file of all these (classes.jar,ejbmodule.jar and web.war).
    All these are at the same level.
    Now when the server starts,it needs some classes to refer.
    The deployed ear should be able refer to my classes.jar through the
    manifest.mf of the ejb as well as the web module file.
    But it not refering.I dont know what is the problem.
    <b>
    Manifest-Version: 1.0
    Class-Path: classes.jar
    Created-By: 1.4.2 (Sun Microsystems Inc.)
    </b>
    Is there something else I need to do?

    if you structure is:
    myear.ear
    -->myejb.jar
    -->mywar.war
    -->classes.jar
    -->META-INF
    ---->manifest.mf
    ---->application.xml
    and the manifest myejb.jar and mywar.war are:
    Manifest-Version: 1.0
    Class-Path: classes.jar
    Created-By: 1.4.2 Sun Microsystems Inc.
    all is fine.
    perhaps your error is when you startup the server. Can you send me you error when is starting server?
    Message was edited by:
    javichin

  • External Jars in JSP Dynpage

    Hi,
    I have implemented reading an XML feed in a Java program using informa api.
    In NWDS, I created a Java Project. And as required added 3 externals jar files.
    I had to import the following:
    import de.nava.informa.core.ChannelIF;
    import de.nava.informa.core.ItemIF;
    import de.nava.informa.impl.basic.ChannelBuilder;
    import de.nava.informa.parsers.FeedParser;
    The program works on run.
    But when I creat a JSP DynPage and I add the follwoing lines:
    <%@ page import = "de.nava.informa.core.* "%>
    <%@ page import = "de.nava.informa.impl.basic.ChannelBuilder "%>
    <%@ page import = "de.nava.informa.parsers.FeedParser "%>
    I get an error: Error occurs during the rendering of jsp component. Even in this project I added external Jar files in the same way.
    Any particular stuff need to reside on the server or something?
    Because I one tried implementing JCO in JSPDynPage by adding the external jar in the project structure and it worked fine.

    Hi Prem,
    Probably the jars you must have added in your last project would be available on the server or they would have been some server related jar files.
    But in the case when you are inclusing some external jars, you need to inclusde it both as "<b>External Jar</b>" and also add it to the <b>lib</b> folder (ie: just copy and pate the jar files in the <b>lib</b> filder).
    <b><a href="http://img142.imageshack.us/img142/8168/solution4gy.jpg">Put the .jar file here</a></b>
    I hope this solves your problem.
    Regards
    Pravesh
    PS: Please consider rewarding points if helpful and solved.

Maybe you are looking for