2 Replies Latest reply on Jul 18, 2006 1:59 PM by Mike Ayers

    Classloading: There are JARs inside my EAR, and my brain hur

    Mike Ayers Newbie

      I have an EAR with JARs inside it. The MET-INF/MANIFEST.MF points to these jars:

      Class-Path: ./first.jar ./second.jar

      ...implying that the appserver should look in the root of the EAR to find these files. This issue has received some attention on these boards, solved by:

      <attribute name="Java2ClassLoadingCompliance">true</attribute>
      <attribute name="UseJBossWebLoader">true</attribute>

      However, this doesn't completely solve the problem. Although the EAR does deploy and run, I still get lots of exceptions at some point in the process which complain that they cannot find /jboss/deploy/first.jar, etc. Also, when the "Init J@ee application" line appears as it opens the EAR, the JAR files are still listed as non-deployable, although in 3.2.6 they are consiedered deployable (don't know if that matters, but I think that if they were considered deployable, JBoss would never go looking for /jboss/deploy/first.jar.

      What else do I need to do here?

        • 1. Re: Classloading: There are JARs inside my EAR, and my brain
          jaikiran pai Master

          I am not sure which version of jboss you are using. Currently, we use JBoss-3.2.3 and we have a similar case where there are jar files in our ear file and the way we configure it is as follows:

          - Create a application.xml file containing the following:

          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
           <display-name>My Struts Example</display-name>
           <java>first.jar</java> <!-- Assuming that first.jar is *directly* under the ear -->

          - Place this application.xml file in the META-INF directory of yourApp.ear

          This works for us without any issues. See if this approach suits you.

          • 2. Re: Classloading: There are JARs inside my EAR, and my brain
            Mike Ayers Newbie

            I'm using 4.0.4, sorry. Our EAR works fine with 3.2.x versions (specifically, 3<=x<=7 have been tested). I tried adding the directives to application.xml as you suggested. It does cause the jars to be listed as deployable, but I still get the problem with JBoss looking for them in the deploy directory first. This isn't really a problem - it's the warning exceptions that are thrown that bother me. Turns out these are just Chicken Little exceptions. When I bothered to look, I discovered that the application was, and had been, running.

            Thanks for the help.