Libraries (.jar, .zip) in ear file.

Hi !
Sorry if someone asked this before.
I have a package (.jar) which would like to be shared by both ejb and war
component, I put them in the ear/lib/, and add an entry in the manifest
file. Somehow I couldn't access those package after deployed in iPlanet, nor
seeing them being extracted to any directories. Do I have to put 2 copies in
each of them in iPlanet ? Or there's any other way to work around this ?
Thanks,
Brandon

Hi,
I haven't tried out this, please try to include this .jar file in one
of the path where the path in application server points to. This might
help. You can find the application server's classpath in
Software/iPlanet->Application Server->6.0->Java->Classpath.
Regards
Raj
Brandon wrote:
Hi !
Sorry if someone asked this before.
I have a package (.jar) which would like to be shared by both ejb and war
component, I put them in the ear/lib/, and add an entry in the manifest
file. Somehow I couldn't access those package after deployed in iPlanet, nor
seeing them being extracted to any directories. Do I have to put 2 copies in
each of them in iPlanet ? Or there's any other way to work around this ?
Thanks,
Brandon

Similar Messages

  • Jar, War or Ear file ?

    Hi,
    I am a total newbie in J2EE technology.
    I am currently using Sun One Application. Using the sample application, it produces all the Jar, War and Ear files.
    My understanding is Jar is produced to be a library-like usage.
    War is for web application.
    And Ear is for what?? oops EJB? Can someone tell me?
    Anyway, my concern is, if I am to produce Ear, war, or Jar file after deploy, I have problems doing the testing. Let's say I want to modify the Jsp file, then I have to use ant to compile all, undeploy the instance and deploy again.
    Any better way?

    your jar files contain your EJBs, your WAR file contains your web application (JSPs, servlets and support) and these are all bundled into your EAR file. All of these files are just zip-formatted archives, you can look at them all via the jar tool (or something like WinZip, if you are so inclined). Each of these will contain a descriptor file (in XML format) - check out the J2EE spec on it.
    Lee

  • Difference between .jar, .war and .ear file

    Hi,
    I am pretty new to J2EE technology.
    I would like to know what is the difference between .jar, .war and .ear files and how they are deployed on webserver.
    Thanks,

    Files with a .jar extension or JAR files, are essentially just a collection of files compressed using the ZIP/ZLIB compression format.
    JAR (short for Java Archive) files were introduced in the early days of Java as a means to conveniently package and distribute Java applications and components. Since then, a number of additions to the Java platform have followed suit. The introduction of the EAR file is one such addition.
    An EAR (Enterprise Archive) file is a JAR file that contains a J2EE application.
    A J2EE application is a group of Web modules that collectively perform as a single entity.
    A Web Module is an entity consisting of one or more resources such as HTML files, Java class files, XML files, etc. Web Modules are packaged in Web Archive (WAR) files.
    Looking at it from a top-down view, EAR files contain JAR files and WAR files. Packaging resources in WAR files, JAR files and eventually EAR files, makes it easy to reuse and reassemble components as new J2EE applications and distribute them to new environments.
    For example, Tomcat deals only with WAR files.
    So, in order to auto-deploy a Web application to a Tomcat environment, you must place an application's WAR file in the appropriate directory or use Tomcat's deployment tools to manually deploy the file.
    If you already have an EAR file that contains the WAR file, you can extract the WAR file and use it as is. If you do not have the EAR file or the WAR file, you can use any number of compliant tools to create the WAR file. Tomcat is a servlet/JSP container available from the jakarta.apache.org site.

  • 3rd party jars/zips in EAR

    Hi
    I have some common 3rd party jars and zips that are accessed by my WARs and EJB
    JARs. Where in my EAR structure do i place them so that these common jars like
    classes12, formulaone etc can be accessed from within my WARs and EJB jars?
    Regards Sudhindra

    http://www.jcp.org
    Cheers
    mbg
    "joe" <[email protected]> wrote in message news:[email protected]..
    >
    what do you mean by "to integrate this back into the specifications"? whatis the
    J2EE way to achieve it if there is one? Thanks
    "Mark Griffith" <[email protected]> wrote:
    Nope, embrace and extend. We are working to integrate this back into
    the
    specifications.
    cheers
    mbg
    "Joe" <[email protected]> wrote in message
    news:3e77c70d$[email protected]..
    Is that part of J2EE or weblogic's implementation?
    "Mark Griffith" <[email protected]> wrote:
    Upgrade to 8.1 and stick the jar's in myEar/APP-INF/lib
    cheers
    mbg
    "Jen" <[email protected]> wrote in message
    news:3e724f46$[email protected]..
    Is there a way to put in one shot instead of modifying every .jar
    and
    ..war's manifest
    file.
    Philip Strube <[email protected]> wrote:
    Hi Sudhindra,
    you can put them in your EAR (on top level or you can create a
    directory
    for them, like "libs" or sth.), and then create class-path entriesin
    the manifest files of your WAR and ejb-jars.
    Example: if myApp.war needs myUtil.jar, then write a line
    Class-Path: myUtil.jar
    in the manifest file of myApp.war. If myUtil.jar is in libs, write
    libs/myUtil.jar and so on.
    -- Philip
    Sudhindra wrote:
    Hi
    I have some common 3rd party jars and zips that are accessed
    by
    my
    WARs and EJB
    JARs. Where in my EAR structure do i place them so that these
    common
    jars like
    classes12, formulaone etc can be accessed from within my WARs
    and
    EJB
    jars?
    Regards Sudhindra

  • Updating Specific Jar in an EAR file

    Hi All,
    Is it possible to update only some jar files in an EAR file.
    This is what I wanted to do. My EAR structure is something like this-
    A.ear
    + B.jar
    + APP-INF/lib/C.jar
    I want to update the B.jar and C.jar with a few class files that I have. Will it be possible to; inside ear and update the specific jar.
    I know if it is a single jar - then that jar -u does the trick.
    Thanks much in advance,
    - Anand<pre></pre>

    Hi,
    I haven't tried what you're asking specifically, but an EAR is, I believe, a .ZIP file with a specific directory structure. So, I'm thinking that you should be able to either:
    1) Unzip the EAR, copy the new JAR (overwriting the old JAR), then re-zip to build the new EAR, or
    2) Just use a ZIP tool to do an update of the JAR(s) to replaced.
    Jim

  • Where to put Third Party Jars in an .ear file

    Where to put Third Party Jar files in an .ear file so that they can be packaged along with the entire application and thus bypass the trouble of putting the third party .jars inside the application server lib directory and set the class path.

    Just put them in the root of your EAR. You can specify them in the classpath of your EJB JAR's manifest.

  • 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

  • EJB - JAR or EAR file reloading - how to get it to work consistently.

    We are using wl 6.0 sp2 rp2 - with 2 WL instances on the same box.
    We have always seemed to have had this headache with WL - getting EJB's
    to reload consistently.
    Does anyone have a sequence of steps they follow to get good consistent
    reloading results from both an EJB in its own JAR or an EAR file?
    If we just copy the file over sometimes it seems to reload and sometimes
    not.
    If we try to use the console to "install an application" again sometimes
    it deploys the EJB's to the wrong server instance!
    Also is there anyway in the Weblogic deployment descriptor to specify
    which instance the EJB should be deployed against?
    Thanks
    Tom

    STARTMODE is only available in WLS 6.1 and not WLS 6.0.
    Deepak Vohra wrote:
    Tom
    Edit the startWeblogic Command Script.
    set STARTMODE=false
    Deepak
    Tom Gerber wrote:
    Is STARTMODE available in 6.0??? I thought that was new to 6.1.
    I'm running on NT so do I set this on the Java command line as a
    -DSTARTMODE=false or is it a regular environment variable?
    Tom
    Deepak Vohra wrote:
    Tom
    In startWebLogic script set STATRTMODE=false
    STARTMODE=false starts server in development mode.
    Deepak
    Tom Gerber wrote:
    We are using wl 6.0 sp2 rp2 - with 2 WL instances on the same box.
    We have always seemed to have had this headache with WL - getting EJB's
    to reload consistently.
    Does anyone have a sequence of steps they follow to get good consistent
    reloading results from both an EJB in its own JAR or an EAR file?
    If we just copy the file over sometimes it seems to reload and sometimes
    not.
    If we try to use the console to "install an application" again sometimes
    it deploys the EJB's to the wrong server instance!
    Also is there anyway in the Weblogic deployment descriptor to specify
    which instance the EJB should be deployed against?
    Thanks
    Tom
    Rajesh Mirchandani
    Developer Relations Engineer
    BEA Support

  • Referencing a jar inside an ear

    Hi,
    I have a program where I need to get a reference to a jar inside an ear
    file. For example, I have this variable set:
    $WL_HOME/config/mydomain/applications/test.ear and I want to set a variable
    for a jar inside this ear.
    Does anyone know the best way to do that?
    Thanks

    When you say "set a variable", do you mean read an XML or properties file
    and modify it and write it back?
    It is relatively simple using the java.util.zip / java.util.jar packages.
    Editing XML is a little harder; I would suggest relying on something like
    JDOM or the libs from The Mind Electric.
    Peace,
    Cameron Purdy
    Tangosol Inc.
    Tangosol Coherence: Clustered Coherent Cache for J2EE
    Information at http://www.tangosol.com/
    "Diane Curley" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    I have a program where I need to get a reference to a jar inside an ear
    file. For example, I have this variable set:
    $WL_HOME/config/mydomain/applications/test.ear and I want to set avariable
    for a jar inside this ear.
    Does anyone know the best way to do that?
    Thanks

  • Error after Deploying a .ear File

    Hi,
    I have deployed an .ear file on the SAP J2EE engine 6.20 on EP6.0 sp2. When I access one of the JSP's, I am getting a NoClassDefFound exception even though the particular jar (xml-apis.jar) file containing the class is in the additional-lib directory. Also, the jar file has been added to the classpath in go.bat? What other changes are to be done for a successful deployment?
    Environment :EP6.0, sp2 hotfix4 on Windows 2003, MS SQL server DB.
    Please reply ASAP
    Thanks
    Bhanu

    hello,
    have you tried including the 3rd party jar in your EAR file itself?
    i use a number of external jars in my web app and ejb, including some xml parsing classes. what i did was to put them all in the EAR, at the root level, in other words, not in a sub-directory. then in my WAR's meta-inf/MANIFEST.MF file reference them in the Class-path. do simililar thing for the ejbs if necessary.
    when you tried to use the inqxml instead, did you make a reference in manager/referecen.txt from your app to the inqmy library? if so, did you look into the inqmyxml.jar to see if the Node class is actually there?
    regards,
    wentao

  • Error deploying a .ear file - Urgent

    Hi,
    I am trying to deploy an .ear file on the SAP J2EE engine.  I am getting a NoClassDefFound exception even though the particular jar (xml-apis.jar) file containing the class is in the additional-lib directory.  Also, the jar file has been added to the classpath in go.bat?  What other changes are to be done for a successful deployment?
    Environment :EP6.0, sp2 hotfix4 on Windows 2003, MS SQL server DB.
    Please reply ASAP
    Thanks
    Bhanu

    hello,
    have you tried including the 3rd party jar in your EAR file itself?
    i use a number of external jars in my web app and ejb, including some xml parsing classes. what i did was to put them all in the EAR, at the root level, in other words, not in a sub-directory. then in my WAR's meta-inf/MANIFEST.MF file reference them in the Class-path. do simililar thing for the ejbs if necessary.
    when you tried to use the inqxml instead, did you make a reference in manager/referecen.txt from your app to the inqmy library? if so, did you look into the inqmyxml.jar to see if the Node class is actually there?
    regards,
    wentao

  • How to Create a jar war or ear--Probelms in deploying

    I have the following dir structure. I am using Struts 1.1 and weblogic 7.0
    APP
    +jsp
    +WEB-INF
    + ---lib
    +--- classes
    +----com
    --ap
    --action
    --beans
    --handler
    --service
    --client
    --ejb
    --valueobject
    1> Do I need to create a ear file since i want both the ejb (under service folder) and war as reusable components. Whenever we have a EJB component do we always need to have an EAR file??
    2> Whats the best way to create the jar, war or ear file. I am facing great difficulty in deploying the war.Do we need to set any classpath before we create the war and jar files except for the deployment descriptors.I have created the ejb descriptors correctly through ejbc.
    3>I have kept struts.jar,log4j.jar under lib folder. However when i create the ear and try to deploy it under weblogic it deploys the war file but gives error in deploying the jar which has the ejb. I have aslo validated the jar using ejbc.
    It gives error indicating that it requires struts.jar in classpath. If we give the classpath of struts.jar at system leve the Application deploys with ease..Can anyone tell whats the error.The jar does not use any strust component .
    4>Also the valueobject which has some beans which are used to populate the jsp through Actionformbean. Is it ok if we give refrences in both ejb jar and war?
    ie while creating jar and war folder have the valueobject in both the files or will it lead to any errors..
    Thanks in Advance
    ....

    Yes, I have tried that. But, as the server is running and the jars are in use, it throws and EditFailedException

  • How to use application params in .EAR files

    When we build an ear file , Weblogic-application.xml provides application-param
    tag?
    are they similar to env-entry in ejb-jar.xml.
    Can I use application-param tag to define a configurable params
    say myName and value as "Harshad"
    How do i read it in the application say a simple java class that is included in
    a jar inside the ear file.

    application-param tag in weblogic-application.xml may be used to define parameters:
    webapp.encoding.default
    webapp.encoding.usevmdefault
    webapp.getrealpath.accept_context_path
    http://e-docs.bea.com/wls/docs81/programming/app_xml.html#1034632
    "Harshad Nanal" <[email protected]> wrote:
    >
    When we build an ear file , Weblogic-application.xml provides application-param
    tag?
    are they similar to env-entry in ejb-jar.xml.
    Can I use application-param tag to define a configurable params
    say myName and value as "Harshad"
    How do i read it in the application say a simple java class that is included
    in
    a jar inside the ear file.

  • Help to solve problem with packaging log4j in a EAR file

    Hi All
    i struggle hard to create a EAR composed of EJB JARs and WARs and the programs
    in these JARs and WARs use log4j to log msg. Because i want all J2EE apps to have
    their own version of log4j library, i package log4j.jar in the EAR file. Below
    is my EAR package structure
    EJB1.jar
    EJB2.jar
    SharedUtilities.jar
    log4j.jar
    log4j.properties
    WEBAPP1.war
    WEBAPP2.war
    META-INF/manifest.mf
    For both EJB1.jar and EJB2.jar's META-INF/manifest.mf, there is a below entries
    Manifest-Version: 1.0
    Class-Path: SharedUtilities.jar log4j.jar
    However, my program always hit below runtime error.
    [java] Caused by: javax.ejb.TransactionRolledbackLocalException: EJB Exception:
    : java.lang.NoClassDefFoundError: org/apache/log4j/PropertyConfigurator
    But the program in EJB1.jar and EJB2.jar seem to have no such problem in loading
    classes in SharedUtilities.jar. The problem can be eliminated if i put log4j.jar
    at system classpath. Can anybody provide me with info on how to package a log4j
    library within a EAR package ?
    In addition, where should i put the log4j.properties so that it will be at search
    path of log4j and automatically loaded by log4j lib
    regards
    Danny

    Hi Slava Imeshev
    I am a bit confused about your reply. As said, the log4j.jar was packaged in my
    ear file. If the log4j.jar was not packaged in ear file, how come the ejb classloader
    can locate it.
    Secondly, if log4j.jar is included in system classpath, the ejb also can load
    log4j classes by system classloader. No "NoClassDeffound" exception is thrown.
    regards
    dso
    "Slava Imeshev" <[email protected]> wrote:
    "dso" <[email protected]> wrote in message
    news:[email protected]...
    Hi Slava Imeshev
    thanks for your response. I am a bit confused about your answer.
    i can't understand why u said the classloader COULD loadorg/apache/log4j/PropertyConfigurator.
    According to the error msg, it said
    " java.lang.NoClassDefFoundError: org/apache/log4j/PropertyConfigurator".
    Seemingly,
    this class in log4j.jar could not be located. But as i said in lastquestion,
    i seemed to have properly
    edit the "META-INF/manifest.mf" in EJB1.jar and EJB2.jar to includelog4j.jar
    in "Class-path" attribute. And my EJB classes have no problem in loadingclasses
    in SharedUtilities.jar. Would u please elaborate on it in more details?
    Sure. NoClassDefFoundError means that a DEPENDING class
    can not be loaded. If the classloader were not able to load the class
    itself, it would give you ClassNotFoundException.
    Just make sure that you don't have the same packages in
    the ear and in the class path so that you don't have classes
    loaded by system classloader trying to load classes loaded
    by ejb classloaders.
    regards
    dso
    "Slava Imeshev" <[email protected]> wrote:
    First, this error means that classloader was able to load
    org/apache/log4j/PropertyConfigurator, but cold not load
    one of depending classes. I'd inspect the CLASSPATH
    to see if there are any log4 classes there.
    Second, you can package your log4.properties into
    log4.jar itself.
    Regards,
    Slava Imeshev
    "dso" <[email protected]> wrote in message
    news:[email protected]...
    Hi All
    i struggle hard to create a EAR composed of EJB JARs and WARs and
    the
    programs
    in these JARs and WARs use log4j to log msg. Because i want all
    J2EE
    apps
    to have
    their own version of log4j library, i package log4j.jar in the EARfile.
    Below
    is my EAR package structure
    EJB1.jar
    EJB2.jar
    SharedUtilities.jar
    log4j.jar
    log4j.properties
    WEBAPP1.war
    WEBAPP2.war
    META-INF/manifest.mf
    For both EJB1.jar and EJB2.jar's META-INF/manifest.mf, there is
    a below
    entries
    Manifest-Version: 1.0
    Class-Path: SharedUtilities.jar log4j.jar
    However, my program always hit below runtime error.
    [java] Caused by: javax.ejb.TransactionRolledbackLocalException:EJB
    Exception:
    : java.lang.NoClassDefFoundError: org/apache/log4j/PropertyConfigurator
    But the program in EJB1.jar and EJB2.jar seem to have no such problemin
    loading
    classes in SharedUtilities.jar. The problem can be eliminated if
    i
    put
    log4j.jar
    at system classpath. Can anybody provide me with info on how to
    package
    a
    log4j
    library within a EAR package ?
    In addition, where should i put the log4j.properties so that it
    will
    be at
    search
    path of log4j and automatically loaded by log4j lib
    regards
    Danny

  • Error Undeploying a EAR File Containing Resource Adapter

    Hi,
    I am trying to undeploy a ear file that contains a
    1) one inbound R.A(resource adapter),
    2) one outbound R.A and
    3) few EJBs.
    The undeploy command "java -jar admin.jar undelpoy..." executes without any error, however the thread process started by the inbound adapter keep running even after undeployment.
    Is there a way to cleanly undeploy a resource adapter (that would delete all the threads created by resource adapter) that's part of a ear file?
    Note: The inbound adapter's deregisterEndpoint method does include the code to call the destroy method on the thread it created.
    Thanks,
    Bhupen

    hello,
    have you tried including the 3rd party jar in your EAR file itself?
    i use a number of external jars in my web app and ejb, including some xml parsing classes. what i did was to put them all in the EAR, at the root level, in other words, not in a sub-directory. then in my WAR's meta-inf/MANIFEST.MF file reference them in the Class-path. do simililar thing for the ejbs if necessary.
    when you tried to use the inqxml instead, did you make a reference in manager/referecen.txt from your app to the inqmy library? if so, did you look into the inqmyxml.jar to see if the Node class is actually there?
    regards,
    wentao

Maybe you are looking for

  • 4:3 aspect woes.  Curse that "widescreen preview"!!

    I searched this subject before posting and couldn't find an answer. I created a slideshow -- with NO audio -- using "Photo-to-Movie" in 4:3. I exported it to iDVD using the program's settings, choosing 4:3 when prompted in iDVD. Even chose a really o

  • Rendering timeline in Premiere

    HI, I have a quite  an annoying problem in Premiere. I work on CS6 Creative Suite. I work with premiere and After Effect through Dynamic Link. Every time I try to render a sequence on the timeline of Premiere, I need to restart my computer in order t

  • Network Address Translation, Automatic Port Forwarding

    Does the Airport Extreme do Network Address Translation? Do I have to do something to make NAT functional? Does the Airport Extreme automatically forward ports? Or is this something I have to do manually sorry if this is discussed already but a Searc

  • Installing Flash 10

    I've been trying to get Flash 10 installed and working on a system. The install goes fine, but when I try to view content, I just get a red x. I've done all troubleshooting steps on the troubleshooting page. I've uninstalled and reinstalled Flash a c

  • My Documents have disappeared?

    I opened my MacAir this morning and the Documents section has disappeared. Does anybody have any idea?