views:

283

answers:

1

My project has several deployed artifacts as ear files. My understanding is that each of the ears will have it's own classloader. Is it possible to tell weblogic to use the same classloader for each of these deployables.

What factors do i need to consider when making this change?

+1  A: 

The reason each Application (EAR) has it's own classloader is for application isolation and independence. Assume you want some common module available for all the EARs ?

If each App is to have common classloader (and common shared libraries) there are 3 ways to do this:

  1. Add the common JARs to the system classloader (BAD idea) as noted here. http://download.oracle.com/docs/cd/E11035_01/wls100/programming/classloading.html#wp1096756

  2. Create common JAR/EAR and deploy it as a shared library as described here. http://download.oracle.com/docs/cd/E11035_01/wls100/programming/libraries.html#wp1071514

  3. If the multiple apps have stuff in common and are not meant to be independent modules, bundle them into a single EAR

JoseK
If i used option 2, how would i tell the individual ears that reference the shared library to use the classloader of the sharedlibrary?
mR_fr0g
I should clarify that my response assumes the need for common classloader is for all the EARs to have access to some common library. In such a case, option 2 simply means the common shared library is available on the classpath of all the referencing EARs.Do you have a different need/definition in your query for a common classloader ?
JoseK