Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Different lib directories of JBoss

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 !

like image 827
Serafeim Avatar asked Jun 17 '10 18:06

Serafeim


1 Answers

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/<server config>/lib.

  • jboss/server/<server config>/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
like image 170
Georgy Bolyuba Avatar answered Sep 29 '22 18:09

Georgy Bolyuba