5 Replies Latest reply on Oct 10, 2006 1:45 PM by gavin.king

    Shared JAR files ?

    balamg

      Can multiple EAR/WAR files share the follwing JAR files by placing them in server/deploy/lib instead of packaging them in each application ?

      jboss-seam.jar
      jboss-seam-ui.jar
      el-api.jar
      el-ri.jar
      jsf-facelets.jar

        • 1. Re: Shared JAR files ?
          gavin.king

          Should be ok. Try it...

          • 2. Re: Shared JAR files ?
            jbmadair

            I've had problems sharing jboss-seam.jar in the server-name/lib dir when I have multiple WARs in separate EARs. This is because if a shared classloader serves up the Seam classes then Seam doesn't shield the webapps from each other. It's not like it doesn't work (AFAIK), namespacing just gets more problematic.

            It's possible that some rocket-science level classloader configuration for JBoss can resolve this, but you might jump of a bridge before reaching that point.

            I would love to see Seam get a little better behaved in this respect, particularly by losing the mutable static var field(s) and keeping separate namespaces for different WARs or EAR/WAR combinations. I'm gonna guess this is a difficult thing to change about Seam though, probably related related to the bytecode rewriting that goes on.

            • 3. Re: Shared JAR files ?
              balamg

              Currently, I am making sure that each EAR file has its own class loader using
              <jboss-app>
              <loader-repository>seam.jboss.org:loader=myear</loader-repository>
              </jboss-app>
              I have 15 odd EAR files, all using the same jars. My aim is to reduce the overall memory footprint of jboss. any other options that anyone else knows of ? Also I have observed PermGen exceptions upon constant redeployments of the EARs. I am using JBoss 4.0.4, ejb3-rc8

              • 4. Re: Shared JAR files ?

                Hi,

                I have one application like this and I put all web used jars in
                deploy\jbossweb-tomcat55.sar\jsf-libs
                and I make small changes in conf/web.xml to use them.

                Of course I style have the warning about SeamListener is not unique (Very stupid check using static variables). Maybe the people who write seam listener don't know nothing about jboss class loader and real J2EE applications.
                If is running in tomcat not mean is Ok for jboss.

                Cristi

                • 5. Re: Shared JAR files ?
                  gavin.king

                  We STRONGLY recommend the use of scoped classloading with Seam, like we use in all the example applications. Yes, we know all about the JBoss UCL.