6 Replies Latest reply on Oct 10, 2007 7:54 PM by patwary_shiva

    location of utility jars (application specific) shared betwe

    asapum

      We are on a migrtion path from Tomcat to JBoss-Tomcat. We have about 6 WAR files that will be deployed to JBoss-Tomcat. Utility classes have been written which are bundled as jars that will be shared across these 6 applications. What is the best location to place them other than including these jar files within each applications WEB-INF/lib directory? Please advise.

      Thank You asapum

        • 1. Re: location of utility jars (application specific) shared b
          jaikiran

          Are these 6 WAR files related? If so, you can create an EAR file out of these WAR and JAR files and deploy the EAR as an application.

          • 2. Re: location of utility jars (application specific) shared b
            asapum

            Thank you for your response! I wish life was that simple.

            The problem is that the development for all this WAR's is done by various teams and each has their own schedule for deployments. It is highly impossible for us to deploy all those WAR files in a EAR file. They have to remain as WAR files only. So, please let me know as to where the shared JARS can be placed?

            Thank You
            asapum

            • 3. Re: location of utility jars (application specific) shared b
              asapum

              Classloading docs for JBoss recommend using Sharing of utility classes with Servlet Spec disabled. So, I tried to set Java2ClassLoading to true in the java-services.xml file, but the server would not start-up. We are using JBoss 4.2. I could not find any docs related to JBoss 4.2 on JBoss website. Has anything changed in JBoss 4.2?

              Thank You
              Manasa

              • 4. Re: location of utility jars (application specific) shared b
                patwary_shiva

                Has any one found the solution . I am having the same issue.

                • 5. Re: location of utility jars (application specific) shared b
                  raist_majere

                  What's the problem using an EAR? You can have an exploded EAR application, and put the WARs inside when theyre ready. You will only have to add them to the application.xml and jboss-app.xml file.
                  To tell JBoss where the shared libs are, use the library-directory tag of jboss-app.xml. In the DTD of jboss-app_ 4_2.dtd in the docs/dtd lib of JBoss you can see that this is what you're looking for:


                  <!-- An .ear file may contain a directory that contains libraries packaged in JAR files.
                  The library-directory element of the .ear files deployment descriptor contains the name
                  of this directory. If a library-directory element is not specified,
                  the directory named lib is used.

                  An empty library-directory element may be used to specify that there is no library directory.

                  All files in this directory (but not subdirectories) with a .jar extension must be made available
                  to all components packaged in the EAR file, including application clients.

                  Used in: jboss-app
                  -->
                  <!ELEMENT library-directory (#PCDATA)>

                  This element is 4.2 specific.

                  • 6. Re: location of utility jars (application specific) shared b
                    patwary_shiva

                    We are on a migrating webl;ogic to JBoss-Tomcat.we are using jboss 4.2.0 version. We have about 4 WAR files that will be deployed to JBoss-Tomcat. Utility classes have been written which are bundled as jars that will be shared across these 4 applications. Can we put them in the shared location(network drive) and war files can refer them.we want to do this because we will have flexibilty to change the code in one of the jars.Weblogic used to allows to doo this bys using post-class path setting in the start up script.

                    Thank
                    shiva