Tuesday, August 10, 2010

JBoss Jars and Placing [JBoss EWP]

In a development environment, we write many applications that depend on third party libraries. So when the development of the application goes on, we depend on different versions of the third party libraries. The big Question is how are we going to organize these third party libraries in JBoss?

JBoss provides us with different options in organizing the libraries.

Client: the client directory contains libraries that are to be used by an application if it needs to communicate with the server instance. For example, if we write an application which connects to a JBoss server instance, then all the jars in this client directory should be available in application class path. We generally don’t place our libraries in directory unless we are writing a JBoss client application or when we are extending JBoss server functionality. If we need to use libraries in this, we can use jbossall-client.jar available in this directory in place all jars.

Lib: the lib directory contains jars that should be available to all servers in order to run. This directory contains server startup libraries. We place our libraries when we are extending the server functionality.dont place your library unless needed.

Common/lib: This directory contains libraries that are to be shared across all server profiles. If we need to provide any global library that is to be used by all applications in all server profiles, we can place the library here.

Lib/endorsed: This directory contains libraries that JBoss uses. If we need to override with a new version of library that JBoss uses, we can place them here.

JBoss/server/server instance/lib: This is the place where we place our instance specific libraries.

Library loading order:

  • Common/lib [ loaded first ]
·         JBoss/server/server instance/lib
·         Application/lib

More articles to come, So Happy coding…..
Read More