4 Replies Latest reply on Sep 19, 2004 11:05 AM by kenroberts

    debate - what is "lib" truly for?

      members of our dev team are having a debate.

      one side of the debate says $JBOSS_HOME/server/app/lib is only for 3-rd party jar files.

      the other says $JBOSS_HOME/server/app/lib is for classes to which access is required from both app (ear) and web (war) sides of the app.

      What does the rest of the world do?

        • 1. Re: debate - what is
          jae77

          to an extent, both sides are correct. you can place 3rd party jars inside the lib directory, however you loose the ability to "hot deploy" them. if you ever need to upgrade a version, you need to restart the server.

          you can also place your "own" jars inside that directory, but the same as above applies.

          you can also deploy "client" jars directly to the deploy directory and have an ear and war both access them.

          in past experiences, i have packaged/deploye all 3rd party jars (w/ the exception of database drivers) inside a sar archive, deployed "client" jars (ie: the client jars a webapp would need to access my own ejb) directly into the "deploy" directory, along w/ any ears/wars.

          either way it works, but placing jars into the lib directory negates the ability to do hot deploymens.

          on a side note, i recently wrote a custom tomcat valve and that class had to be placed inside the "lib" directory else tomcat threw ClassNotFoundExceptions on startup.

          so - as i stated before, either way works, but what will work best for you dependencies between your own apps, any "custom" jboss/tomcat (ie: valve/interceptor) code you may have written, etc.

          • 2. Re: debate - what is
            anil.saldhana

            lib directory is for libraries that you want statically loaded across all apps in that configuration (all/Default etc). A good candidate is database drivers. Ofcourse you lose hot deployment capabilities. But if you have libraries that you want shared across all apps, you can place in lib. Does not have to be 3rd party alone.

            • 3. Re: debate - what is

              Thanks all for your insightful comments!

              • 4. Re: debate - what is
                kenroberts

                 

                "jae77" wrote:
                you can also deploy "client" jars directly to the deploy directory and have an ear and war both access them.

                in past experiences, i have packaged/deploye all 3rd party jars (w/ the exception of database drivers) inside a sar archive, deployed "client" jars (ie: the client jars a webapp would need to access my own ejb) directly into the "deploy" directory, along w/ any ears/wars.
                -------
                jae77, I think you have just saved me a lot of trouble. You may have cut the memory footprint of our product by about 60%.