views:

36

answers:

1

There is a number of different lib directories JBoss (5.1.0) uses: I can find jboss/lib, jboss/lib/endorsed, jboss/common/lib, jboss/server/default/lib and of course the jboss/server/default/deploy/myapp/WEB-INF/lib (am I missing something ?).

From the above, I know that I need to use the last one (WEB-INF/lib) to put any jars my app needs. What about all the others ? What is their use and what should I put there ? Why put it there and not in the WEB-INF/lib ?

Thanks !

+2  A: 

Other folders are for different sorts of shared libs. For example, if you have 10 apps using same DB driver, there is really no reason to keep one db driver jar per application (i.e. 10 jars). In that case you can simply put it into jboss/server//lib.

  • jboss/server//lib: all libs here are shared between all apps in given server config
  • jboss/common/lib: shared between all server configs
  • jboss/lib: these are libs for server itself (if I am not mistaking, they are also on your app classpath)
  • jboss/lib/endorsed: this is the same as above, only if you put a lib here, it will always be found before similar lib in jboss/lib. The idea is similar to Endorsed Standards Override Mechanism of JDK
Georgy Bolyuba