3 Replies Latest reply on Oct 2, 2002 1:39 PM by Matt Goodall

    app/ejb deploy unjars and loads embedded jars

    Bob Price Newbie

      I have an EAR that deploys/works fine on JBoss 2.x, but has a number of weird errors on 3.0. After digging a bit I found that 3.0 appears to recursively unjar any jar file it finds in the EAR (and its WAR and EJB JAR files) and tries to load anything it finds there that looks "loadable".

      This is causing me problems because (as just one example) I have a complex application where one EJB can find (via multicast) and make use of remote processing nodes to distribute a compute-intensive problem. To do this, it can send to a remote node one of its embedded jar files (which from the EJB's point of view is simply a resource in its classpath), and this jar may have native code such as a dynamic library in it.

      For example, running JBoss on Solaris, it failed to deploy my EAR because it found a Linux shared library file which it could not load on Solaris, and this library was inside a jar, which was inside another jar, which was inside the EJB jar, which was inside the EAR.

      Why does JBoss 3.0 try to unjar absolutely everything and try to deploy anything that looks loadable? It seems to me that when I deploy an EAR it ought to examine the application.xml and deploy the WAR and EJBs it specifies, and nothing else.

      Is this a (mis-)feature that I can turn off?

      Its causing a number of other errors that I won't try to describe here, but are very annoying and limiting to what I am trying to do.

      Thanks!
      Bob

        • 1. Re: app/ejb deploy unjars and loads embedded jars
          Matt Goodall Newbie

          This has to be a bug.

          I'm seeing the same problem here. One of my WAR's dependent JARs contains EJBs and an ejb-jar.xml. Even though the dependent JAR is not listed as a module in application.xml the JBoss deployer is deploying it (again).

          Does anyone know how to stop the deployer doing this?

          Thanks, Matt

          • 2. Re: app/ejb deploy unjars and loads embedded jars
            Adrian Brock Master

            3.0 was changed to support more complicated packaging.
            Looking the the code,

            /**
            * This method returns true if the name is a recognized archive file.
            * This can be overridden for alternate behaviour.
            *
            * @param name The "short-name" of the URL. It will have any trailing '/'
            * characters removed, and any directory structure has been removed.
            * @param url The full url.
            *
            * @return true iff the name ends in a known archive extension: jar, sar,
            * ear, rar, zip, wsr, war, or if the name matches the native
            * library conventions.
            */
            protected boolean isDeployable(String name, URL url)
            {
            return name.endsWith(".jar")
            || name.endsWith(".sar")
            || name.endsWith(".ear")
            || name.endsWith(".rar")
            || name.endsWith(".zip")
            || name.endsWith(".wsr")
            || name.endsWith(".war")
            || (name.endsWith(nativeSuffix) && name.startsWith(nativePrefix));
            }

            Changing the suffix will stop it deploying, but
            I can't guarantee the behaviour won't change again.

            Perhaps you should raise a bug or feature request
            at www.sf.net/projects/jboss

            Or maybe you can put the jars somewhere else
            and configure the url for the jars using a
            resource-ref?

            Regards,
            Adrian

            • 3. Re: app/ejb deploy unjars and loads embedded jars
              Matt Goodall Newbie

              > Perhaps you should raise a bug or feature request
              > at www.sf.net/projects/jboss

              Looks like it's already been raised, http://sourceforge.net/tracker/index.php?func=detail&aid=589808&group_id=22866&atid=376685.