Unable to resolve setting of dependent jar file in ear

Hi,
I have an .ear file which as an ejb.jar and dependent.jar file. Now i set the classpath in MANIFEST.MF of ejb.jar and tried to deploy in weblogic server7.0 but my ejb is not able to identity my dependent.jar its throwing class not found error. I even tried setting up classpath even @ my MANIFEST.MF of ear also. still not able to resolve.
So let me know does dependent.jar in ear is suppoted are not?

Hello Sanjay,
This should work without any problems. Can you provide your manifest.mf file?
Meanwhile, refer to the following link for more documentation about WebLogic classloading
and how to specify a manifest.mf file to do what you're trying to achieve:
http://edocs.bea.com/wls/docs70/programming/classloading.html#1073491
Best regards,
Ryan LeCompte
[email protected]
http://www.louisiana.edu/~rml7669
Sanjay <[email protected]> wrote:
Hi,
I have an .ear file which as an ejb.jar and dependent.jar file. Now
i set the classpath in MANIFEST.MF of ejb.jar and tried to deploy in
weblogic server7.0 but my ejb is not able to identity my dependent.jar
its throwing class not found error. I even tried setting up classpath
even @ my MANIFEST.MF of ear also. still not able to resolve.
So let me know does dependent.jar in ear is suppoted are not?

Similar Messages

  • Unable to resolve 'app/ejb/Common.jar#SequenceInstrument'

    I have developed a module with weblogic6.1 , but when I migrate it to weblogic
    7 ,it alway appears errors as following.
    I have build with weblogic 7 for many times , but nothing change , please help
    me.
    ------error info ----
    weblogic.management.ApplicationException: Prepare failed. Task Id = 7
    Module Name: Common, Error: Exception while rollback of module : EJBModule(Common,status=NEW)
    Common.jar; nested exception is:
         javax.naming.NameNotFoundException: Unable to resolve 'app/ejb/Common.jar#SequenceInstrument'
    Resolved: 'app/ejb' Unresolved:'Common.jar#SequenceInstrument' ; remaining name
    'Common.jar#SequenceInstrument'
    TargetException: weblogic.ejb20.UnDeploymentException: Common.jar; nested exception
    is:
         javax.naming.NameNotFoundException: Unable to resolve 'app/ejb/Common.jar#SequenceInstrument'
    Resolved: 'app/ejb' Unresolved:'Common.jar#SequenceInstrument' ; remaining name
    'Common.jar#SequenceInstrument'
         at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:661)
         at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:552)
         at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:1056)
         at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:724)
         at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:24)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)

    Hello Sanjay,
    This should work without any problems. Can you provide your manifest.mf file?
    Meanwhile, refer to the following link for more documentation about WebLogic classloading
    and how to specify a manifest.mf file to do what you're trying to achieve:
    http://edocs.bea.com/wls/docs70/programming/classloading.html#1073491
    Best regards,
    Ryan LeCompte
    [email protected]
    http://www.louisiana.edu/~rml7669
    Sanjay <[email protected]> wrote:
    Hi,
    I have an .ear file which as an ejb.jar and dependent.jar file. Now
    i set the classpath in MANIFEST.MF of ejb.jar and tried to deploy in
    weblogic server7.0 but my ejb is not able to identity my dependent.jar
    its throwing class not found error. I even tried setting up classpath
    even @ my MANIFEST.MF of ear also. still not able to resolve.
    So let me know does dependent.jar in ear is suppoted are not?

  • Why so many dependent jar files?

    Crystal Report needs too many dependent jar file. What is the alternative way to minimize dependent jar files or club together as one jar?
    Thanks,
    Venkat

    If you're using the Java Reporting Component (JRC), then I recommend upgrading to the newest version - [Crystal Reports For Eclipse 2.0|https://www.sdn.sap.com/irj/boc/crystalreports-java], where the number of jars are significantly decreased.
    The reason why 11.5 had so many Jars was that the JRC and RAS and Enterprise SDKs shared libraries, and so the jar files were broken down along functional lines.
    Since CR4E 2.0 is a separate stream, the packaging is simpler.
    Jar file count dependencies is always a touchy thing - break it down along functional lines, and there's complaints that there's too many.  Consolidate to a few, and there's complaints that the files are too large, and why can't it be broken down into smaller jars?
    Sincerely,
    Ted Ueda

  • How to share dependant jars across rars & ears / avoid classcast exceptions

    <b>How can one share dependant jars between a ear application and a resource adapter and avoid getting a ClassCastException? </b>
    <P>
    In some appservers(such as Oracle) the resource adapter is the parent of your ear classloader, so a single instance multiple classloader problem doesn't occur. But in some appservers such as BEA Weblogic this isn't the case. Not sure why BEA decided to make resource adapter class loader seperate and not the parent of ear loader...
    <P>
    If I bundle the resource adapter specific classes in the corresponding module archive file, I will get a class cast exception, becos I will have a <i>single instance and multiple class loader situation</i> (assuming resource adapters uses its own classloader).
    <P>
    Second question related to the above: Web logic documentation recommends that we bundle the common files in APP-INF direcotory for embedded resource adapter apps. If I start bundling the resource adapter in an ear file, for every ear app we will have a rar bundled. What about the JNDI names? won't you have to rename the resource adapter differently for each ear so that there is no jndi name clash? Doesn't this defeat the purpose of having one common connector for all apps?
    <P>
    Here is a detailed description of what I want:
    Let say you have a ear file. Let's say there is a common.jar shared between your ear application (say the ejb module uses it), and your resource adapter.
    <P>
    In the case of Oracle's OC4J I can see there won't be any problem of having this common.jar part of the resource adapter(RA). When the RA class loader loads the rar, it makes sure the common.jar files are accessible in the chain of all class loaders it is a parent of. So, the ear loader, ejb loader etc...will have visibility -> hence no class cast exception.
    <p>
    But what do clients do when they want to have their ear deployable across multiple appservers not just oc4j. BEA recently changed their class loader structure...their resource loader is no longer parent of the ear, so the ejb app in the ear doesn't have visibility into common.jar packaged with rar. So, the only solution was to bundle the common.jar file with the ear. But this causes problems, because we can have a situation where certain object instances (that are not serialized or copied) can be shared across class loaders. This ends up in the single instance multiple class loader situation->hence classcastexception.
    <p>
    The only solution I found was to make the common.jar file a shared library. That way only one copy of the class files are there for both the rar and the ear and its visibility is there not only for rar but for ear since it is loaded by the system class loader or shared library class loader (if ther eis one such).
    <P>
    Please convey best practise recommendation.
    Sudhakar

    Pete <[email protected]> wrote:
    Is there a way to have a non-EJB jar at the EJB classloader level ? Sure, just add it to the Class-Path: manifest entry in your ejb.jar.
    Dimitri

  • How many Ways jar files from ear file on a jboss can be downloaded on clien

    Aoa
    How many Ways jar files from ear file on a jboss can be downloaded on client side
    like jnlp etc..
    Regards
    M Fazal Ur Rehman

    First, you need to be able to boot from the Recovery HD:
    Boot Using Command+R keys:
      1. Restart the computer.
      2. Immediately after the chime press and hold down the
          "COMMAND" and the "R" keys together.
      3. Release the keys when the Utilities Menu appears.
    Once at the Utilities Menu select Terminal from the Utilities menu in the screen's menubar. Now, you need to know where these new files are located. You move to any location using the 'cd' command such as cd /Users/user_name/Documents, then press RETURN. Replace user_name with your actual username. Next you need to do a directory listing to see if your files are in that location, Documents. Use ls -al to do a directory listing of the files and folders in Documents. If you find your new files there, then connect an external drive or flash drive. You will need to know the name you have assigned to this drive. It needs to be already formatted. Copy your files using cp /Documents/filename /Volumes/volname/filename. Replace volname and filename with those that apply. Press RETURN.
    Or take it to your local Apple Store and see if they can do the chore for you.

  • Unable to get jarsigner to sign jar file using pkcs11 smartcard

    I'm using a JDK jdk1.6.0_14 with a datakey smartcard with the below info in pkcs11.cfg file:
    name = DK330
    library = c:\windows\system32\dkck232.dll
    I have also configured the java.security file to include the security.provider.10=sun.security.pkcs11.SunPKCS11 c:/pkcs11.cfg
    I have my environment set for the below to keep it simple as possible:
    JAVA_HOME=C:\Program Files\Java\jdk1.6.0_14
    CLASSPATH=C:\Program Files\Java\jdk1.6.0_14\lib
    PATH=C:\Program Files\Java\jdk1.6.0_14\bin;c:\windows;c:\windows\system32
    1) I am able to Confirm that the secret key is present in the keystore
    keytool -v -list -keystore NONE -storetype PKCS11 -storepass xxxxxx
    Keystore type: PKCS11
    Keystore provider: SunPKCS11-DK330
    Your keystore contains 1 entry
    Alias name: CS.NOLSC.002's U.S. Government ID
    Entry type: PrivateKeyEntry
    Certificate chain length: 1
    Certificate[1]:
    Owner: CN=CS.NOLSC.002, OU=USN, OU=PKI, OU=DoD, O=U.S. Government, C=US, OU=PKI, OU=DoD, O=U.S. Government, C=US
    Issuer: CN=DOD CA-14, OU=PKI, OU=DoD, O=U.S. Government, C=US
    Serial number: 3e8e
    Valid from: Mon Feb 05 14:53:22 EST 2007 until: Thu Feb 04 14:53:22 EST 2010
    Certificate fingerprints:
    MD5: 9D:34:AF:D8:DE:18:15:78:D6:88:3D:37:83:FA:DC:E8
    SHA1: 8A:BB:39:D5:2B:45:F7:CE:A3:93:C5:71:5C:36:DC:FE:3F:B4:7D:9A
    Signature algorithm name: SHA1withRSA
    Version: 3
    Extensions:
    #1: ObjectId: 2.5.29.15 Criticality=true
    KeyUsage [
    DigitalSignature etc
    2) When I try to sign the applet using the below commands I get the same errors:
    command 1:
    jarsigner -keystore NONE -storetype PKCS11 -providerClass sun.security.pkcs11.SunPKCS11 -providerArg ${java.home}/lib/security/pkcs11.cfg sfilechooser.jar "CS.NOLSC.002's U.S. Government ID"
    I get this error::
    jarsigner error: java.security.ProviderException: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_ATTRIBUTE_TYPE_INVALID
    command 2:
    jarsigner -verbose -keystore NONE -storetype PKCS11 -storepass xxxxxx sfilechooser.jar "CS.NOLSC.002's U.S. Government ID"jarsigner error: java.security.ProviderException: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_ATTRIBUTE_TYPE_INVALID
    I can also confirm the jar file that I'm trying to sign is unsigned using the below command without problem.
    C:\Program Files\Java\jdk1.6.0_14\bin>jarsigner -verify -verbose -certs -keystore NONE -storetype PKCS11 sfilechooser.jar
    Enter Passphrase for keystore:
    0 Wed Jul 08 09:36:06 EDT 2009 META-INF/
    71 Wed Jul 08 09:36:06 EDT 2009 META-INF/MANIFEST.MF
    4227 Tue Jun 09 09:56:20 EDT 2009 DirList.class
    0 Wed Jul 08 09:29:52 EDT 2009 FileChooserPackage/
    4728 Tue Jun 09 09:56:20 EDT 2009 FileChooserPackage/DirUtil.class
    809 Fri May 29 13:05:42 EDT 2009 FileChooserPackage/FileChooserBean$AWTFileDialogThread.class
    765 Fri May 29 13:05:42 EDT 2009 FileChooserPackage/FileChooserBean$AWTSaveDialogThread.class
    819 Tue Jun 09 09:56:20 EDT 2009 FileChooserPackage/FileChooserBean$FileChooserBeanThread.class
    1015 Tue Jun 09 09:56:20 EDT 2009 FileChooserPackage/FileChooserBean$FormsDecoderException.class
    815 Tue Jun 09 09:56:20 EDT 2009 FileChooserPackage/FileChooserBean$SaveFileChooserThread.class
    17198 Tue Jun 09 09:56:20 EDT 2009 FileChooserPackage/FileChooserBean.class
    s = signature was verified
    m = entry is listed in manifest
    k = at least one certificate was found in keystore
    i = at least one certificate was found in identity scope
    jar is unsigned. (signatures missing or not parsable)
    ======================================
    What could be my problem to get my applet signed? I'm at a loss.

    I found the problem.
    I was able to use jarsigner correctly after I backed off on the GemPlus driver version from v4.7.062 file name dkck232.dll to the previous version of dkck201.dll at v4.7.062.

  • How to set path to jar file (classes)?

    hi,
    i have a java program which uses a jar file (lots of classes). so, i run them all in eclipse but i want to run it on a command line, like through cmd from run.
    the classes are found in a different folder, and the code snippet is found in another folder. so where or how to set the path to the jar file?

    Write
    c:/java -?
    you can use the -cp pption to use your jar file or a folder with classes.
    java -cp jar1.jar myclass.class

  • Specifying the version of dependent jar file?

    Hi all
    At the moment I am fighting with some class loading issues in a J2EE Appcontainer... Acutally the app server uses a different version of a jar file than my application.. Now the classloader always uses
    the already loaded classes of the AppServers jar Version instead of those that I want..
    I have my application together with the dependent jar packaged together into one jar file... In the manifest I lsit the dependency...
    Now my question is if its possible to explicitly state the version of the package that my jar is dependent of...
    Any help would be appreciated
    regards
    tom

    Vijay
    Acutally I just read through the thread. Actually what I am working on is an J2EE App Containing a couple of EJB (2.0) components in different jars, some utility jars and 2 Wars. All this is packaged together into an ear.
    Now Actually the basic structure is like:
    Ear
    --> WAR1
    --> webinf containing classes and manifest with dependent jars
    --> War2
    --> EJB Jar
    --> metinf containing deployment desc and manifest where the manifest references JDom-b10.jar on the classpath
    --> Also conatiner JDom-b10.jar
    Acutally the JDom.jar is already loaded by the Application Server (Jboss 3.2.3) in its bootstrap loader... I need to have the b10 as otherwise some other 3rd Party stuff of the Ejb is not running...
    Now I expected the classloader to prefer the direct deployment unit against all parents and delegating loader... but it doesnt:
    15:17:04,011 INFO [STDOUT]
    org.jdom.Document(1bb8ea).ClassLoader=org.jboss.system.server.NoAnnotationURLClassLoader@e3b895
    ..org.jboss.system.server.NoAnnotationURLClassLoader@e3b895
    ..sun.misc.Launcher$AppClassLoader@e80a59
    ....file:/C:/Entwicklungstools/jboss-3.2.3_tomcat-4.1.24/bin/
    ....file:/C:/Entwicklungstools/abaXX/components36/lib/3rdparty/oracle9iR2.jar
    ....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/lib/tools.jar
    ....file:/C:/Entwicklungstools/jboss-3.2.3_tomcat-4.1.24/bin/run.jar
    ..sun.misc.Launcher$ExtClassLoader@1ff5ea7
    ....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/jre/lib/ext/dnsns.jar
    ....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/jre/lib/ext/ldapsec.jar
    ....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/jre/lib/ext/localedata.jar
    ....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/jre/lib/ext/sunjce_provider.jar
    ++++CodeSource: (file:/C:/Entwicklungstools/jboss-3.2.3_tomcat-4.1.24/lib/jdom.jar <no certificates>)
    Implemented Interfaces:
    ++interface java.io.Serializable(f62373)
    ++++ClassLoader: null
    ++++Null CodeSource
    ++interface java.lang.Cloneable(13e8d89)
    ++++ClassLoader: null
    ++++Null CodeSource
    This above is a small JBoss utility acutally printing out the watched URLs of the CL and the Codesource of a class... .. Now actually the classloader shouldn't use the Jdom.jar mentioned as source but the one listed here:
    15:16:24,308 INFO [EJBDeployer] nested deployment: file:/C:/Entwicklungstools/jboss-3.2.3_tomcat-4.1.24/server/tebs/tmp/deploy/tmp27652tebs-0.1-SNAPSHOT.e
    ar-contents/tebs-migration-0.1-SNAPSHOT.jar-contents/jdom-b10.jar
    Actually I think the problem is pretty close to the thread you mentioned before... AFAIK the classloaders in J2EE Containers have to prefer the direct deployment unit (in this case the jar and its content) to any other parent class loaders files... I also thought that there can be mulitple versions of a class file in one VM an that the appserver has to preserve every app from using a class of another app... So that there is some housing principles....
    As I could not figure out how to solve this I came to the question regarding versioning... As both JDom.jars contain version information this would solve my probem... But as you already mentioned AFAIK there is only support to give some verision informationen about a jar in the manifest but nothing mentions that you can explicitely request a specific version.
    So If anyone has a clou how I get that crapp working I would be very thankful
    Tom

  • How to dynamically find the dependent jar files on user's PC

    I've written an application to deal with JTAPI. Unfortunately the implementations by vendors are different in terms of file names. Ideally I'd like to load jars based upon what's installed, e.g. load jtapi.jar when Cisco is installed, or Escjtapia.jar when it's Avaya. The application uses a small subset of JTAPI so different implementations should not yield any different results.
    I edited the manifest file in my jar so that the Class-path has both jar file names for Cisco and Avaya. I didn't enter any path, hoping the CLASSPATH of Windows would be searched, but it is not the case. Also, if other vendors are supported in the future, I might have to add all different file names in the manifest. I don't think the class loader will work in my case, as I may not know the class name at all. I just want to search the system's classpath the find any jar complys to JTAPI and load it.
    Anybody can give suggestions on deployment? Thanks!

    I found it. EXIT_SAPLV01Z_001 does the trick. A package contains many User-Exits, BADIs and enhancement points, so it took me a while to go thru all of them.

  • Unable to  rectify error while running jar file

    Hi Everyone,
    I have a swing component in menu folder,which consists of .class files with main().I even created a executable jar file mentioning Main-Class:menu.Menu1.I'm getting an error Failed to load main class.May i know wats ths problem?
    Thanks in advance.

    http://forum.java.sun.com/thread.jspa?threadID=549376&start=0

  • [noob] how to include third part jar file in ear

    Hi,
    eveything is in the subject. It's quartz that I'm using btw.
    Regards
    Fred

    Hello,
    You are using the internal deployment file?
    <yourapp>.deploy?
    1) Place the file in the WEB-INF/lib directory
    2) Right click <yourapp>.deploy file and select properties
    3) File Groups -> WEB-INF/Lib -> Contributers and select your jar file.
    4) Rebuild the ear, done
    -Anton
    PS Be carefull, depending on the Application server you are using the quartz library COULD already be present (Most have it) and this could be a different version!
    If this is the case you need to tell the application server to load classes from the web-inf directory first!
    With the Oracle OC4J containers this can be done during deployment, classloaders and select search local classes first.
    With Weblogic you will need the deployment descriptor 'weblogic.xml' and add:
    <container-description>
    <prefer-web-inf-classes>true</prefer-web-inf-classes>
    </container-description>

  • WAR Can't find class in JAR file in EAR/lib

    Hi,
    I have 1 EAR file with 1 WAR and 1 EJB-JAR file. Our main business-code is in a JAR-file which is placed in the EAR/lib/ folder along with the rest of the shared JAR-files.
    When i deploy the EAR the EJB gets deployed fine but when the WAR gets deployed, we get a ClassNotFoundException. We configured a class as a ServletContextListener (Which is part of the jar) in the web.xml so at startup it should perform some initiation. But since it can;t be found....
    I've tried changing the Mainfest.mf to include a CLASSPATH attribute with ./lib/x.jar but it stil the same problem. The only thing that solves it is to put it in the WEB-INF/lib folder.
    What am i doing wrong?
    Thanks,
    Maarten

    Here it is
    <?xml version="1.0"?>
    <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN' 'http://java.sun.com/dtd/application_1_3.dtd'>
    <application>
         <display-name>spg-online</display-name>
         <module>
              <web>
                   <web-uri>appname.war</web-uri>
                   <context-root>appname</context-root>
              </web>
         </module>
         <!--module>
              <ejb>appname-ejb.jar</ejb>
         </module-->     
    </application>
    My app follows the basic structure of an EAR-file:
    EAR
    META-INF
    application.xml
    lib
    appname.jar
    a.jar
    spring.jar
    appname.war
    appname-ejb.jar
    The meta-inf of the war-file looks like this:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.6.5
    Created-By: 1.4.2_08-b03 (Sun Microsystems Inc.)
    Class-path: ./lib/appname.jar ./spring.jar
    I let ANT generate the Class-path:
    <jar jarfile="${dist.home}/${component.name}.war">
    <fileset dir="${build.home.webroot}" />
    <!-- dependency -->
    <manifest>
    <attribute name="Class-Path" value="${lib.project.manifest.classpath}"/>
    </manifest>
    </jar>

  • WL tries to deploy utility jar file in .ear as an EJB

    I have an ear containing two ejb jars, one webapp war and a utility jar
    (common.jar). Deploying to
    WebLogic 6.1 sp2 results in deployment errors because WebLogic thinks
    the common.jar in a
    lib directory in the ear is an ejb jar:
    ==================================================================
    ><Apr 22, 2002 4:42:36 PM MDT> <Error> <J2EE> <Error deploying
    >application lib/common:
    >
    >Unable to deploy EJB: lib/common.jar from lib/common.jar:
    >
    >An error occurred while reading the deployment descriptor. The error was:
    > java.io.FileNotFoundException: META-INF/ejb-jar.xml not found in jar file
    > at weblogic.ejb20.dd.xml.DDUtils.getEntry(DDUtils.java:332)
    > at weblogic.ejb20.dd.xml.DDUtils.getEjbJarXml(DDUtils.java:236)
    >.........
    >===================================================================
    Why does it think common.jar contains an EJB? My application.xml is:
    >
    ><application>
    > <display-name>TestUnit</display-name>
    > <module>
    > <ejb>TestUnit1.jar</ejb>
    > </module>
    > <module>
    > <ejb>TestUnit2.jar</ejb>
    > </module>
    > <module>
    > <web>
    > <web-uri>WebApp1.war</web-uri>
    > <context-root>WebApp1</context-root>
    > </web>
    > </module>
    ></application>

    Hi.
    Please open a case with support.
    Regards,
    Michael
    Rick Holland wrote:
    I have an ear containing two ejb jars, one webapp war and a utility jar
    (common.jar). Deploying to
    WebLogic 6.1 sp2 results in deployment errors because WebLogic thinks
    the common.jar in a
    lib directory in the ear is an ejb jar:
    ==================================================================
    <Apr 22, 2002 4:42:36 PM MDT> <Error> <J2EE> <Error deploying
    application lib/common:
    Unable to deploy EJB: lib/common.jar from lib/common.jar:
    An error occurred while reading the deployment descriptor. The error was:
    java.io.FileNotFoundException: META-INF/ejb-jar.xml not found in jar file
    at weblogic.ejb20.dd.xml.DDUtils.getEntry(DDUtils.java:332)
    at weblogic.ejb20.dd.xml.DDUtils.getEjbJarXml(DDUtils.java:236)
    ===================================================================Why does it think common.jar contains an EJB? My application.xml is:
    <application>
    <display-name>TestUnit</display-name>
    <module>
    <ejb>TestUnit1.jar</ejb>
    </module>
    <module>
    <ejb>TestUnit2.jar</ejb>
    </module>
    <module>
    <web>
    <web-uri>WebApp1.war</web-uri>
    <context-root>WebApp1</context-root>
    </web>
    </module>
    </application>
    Michael Young
    Developer Relations Engineer
    BEA Support

  • How to access a jar file in EAR file?

    I have a EAR file which contains EJB.jar file and util.jar file. Outside of EAR, I mean in client side, I need to reference util.jar file. How can I access it?
    EAR structure is
    |--+META-INF/
    |--|---application.xml
    |--|---manifest.mf
    |--EJB.jar
    |--|---+MEAT-INF/
    |--|---|--- deployment descriptors...
    |--|---|--- manifest.mf
    |--|--- EJB classes
    |--Util.jar
    Util.jar must be executed in server side. If I just add Util.jar in client program's classpath, when client program is executed, serverside Util.jar is executed? Or what else I should do in the client program to reference server-side Util.jar?

    Excellent question. I don't see any client-jar in your EAR file structure. So I am assuming you are writing a separate client application which will talk to the ejbs deployed as part of this EAR. You need to do the following:
    Write another EAR file with the following structure:
    ear:
    META-INF/application.xml
    util.jar
    client.jar
    client.jar should have a META-INF/MANIFEST.MF and that should contain Class-Path:util.jar and value for Main-Class attribute.
    Now deploy this new ear to your application server and execute it using Application Client Container that comes with your app server.
    If you don't want to write another EAR file, then bundle th client.jar in your original EAR file.
    Points to note are:
    you have to repackage util.jar again inside this ear file.
    For portability reason, you should use Class-Path manifest entry in client.jar. Refer to http://java.sun.com/j2ee/verified/packaging.html and J2EE platform spec section #8.2.
    Hope this helps,
    Sahoo

  • How to include an external jar file in .EAR project

    Hello All,
    I have created a web service through java class in sap netweaver 7.1.
    For database connection i want to add external jar file as reference. could you all please tell me how to do this or can i get some scenario where it is explained.
    Please Help
    Regards,
    Vanita Jain

    Hi Vanita,
    open your project in nwds > right click on the project > click on properties option from the menu > click on java build path from the left-side navigation of the window > and click on libraries in the right side tab > here you'll get a button called add external jars > clicking to this, will open browser window to select a jar file.
    Regards,
    Sen

Maybe you are looking for