2 Replies Latest reply on Dec 22, 2010 7:39 AM by bmathus

    Jboss 5.1 GA common/lib

      Hi,

       

      If I need to update a jar (newer version) located in <JBOSS_HOME>/common/lib is it safe to replace it or should I deploy it in <JBOSS_HOME>/server/default/lib?

       

      What happens if the same jar (but different version) is deployed on both locations (<JBOSS_HOME>/common/lib and <JBOSS_HOME>/server/default/lib)? Which one will get priority?

       

      Thanks.

        • 1. Re: Jboss 5.1 GA common/lib
          jaikiran

          If the jar is required for your application, then you should package it within your application and configure classloading:

           

          http://community.jboss.org/wiki/classloadingconfiguration

          http://community.jboss.org/wiki/jbossclassloadingusecases

           

          Replacing the jars shipped in JBoss AS is never recommended.

          • 2. Re: Jboss 5.1 GA common/lib
            bmathus

            Hi,

             

            I don't want to hijack the thread, but as I'm having the same question, I guess it's better to grow this thread instead of creating a new one. This will help keep the information in one place.

             

            I feel there's a real useful use case behind for this. So I'll try to rephrase.

             

            What if you have say 20 isolated ears that rely on the same dependencies. Cluttering each ear with those dependencies is a waste of disk and RAM (since classes will be loaded many times, and the exploded ear will take more place on the hard disk).

             

            Is there a right place to put those common app jars inside JBoss?

            (like server/production/lib, but you seem to say it's not good as JBoss will take everything without ordering between common/lib and server/xxx/lib...)

             

            Really, I feel this is a common need, but I don't find anything about this particular subject on the web. I'll be delighted to write about it when I'll be less green, but for the moment I'm not sure of anything yet.

             

            Thanks a lot.

            Baptiste