0

I have an EAR with multiple MDBs in it. Each MDB jar has its own application context. When a message arrives I can see from the logging that the appropriate MDB initialises, but it obtains the application context from different MDB!

I thought each EJB should have it's own classloader. It seems it doesn't. How can I enforce each MDB to load its own app context?

I am using WebSphere 7.

My project structure is:

META-INF/
META-INF/MANIFEST.MF
topicreader-ejb-mdb01.jar
topicreader-ejb-mdb02.jar
lib/
lib/3rdpartylib01.jar
lib/3rdpartylib02.jar
... etc

The content of the mdb jars is:

applicationContext.xml
com/mycompany/ ... (classes)
META-INF/ejb-jar.xml
META-INF/MANIFEST.MF
MaDa
  • 10,511
  • 9
  • 46
  • 84
Synesso
  • 37,610
  • 35
  • 136
  • 207

1 Answers1

0

In WAS you can change the classloader order for the WARs!!, I hope you can do the same for the jars. Normaly the class loader order it is "parent first". Try "Parent Last".

Ralph
  • 118,862
  • 56
  • 287
  • 383
  • Thanks, I was just taking a look at that here: http://stackoverflow.com/questions/813202/can-i-set-the-classloader-policy-for-websphere-in-the-ibm-web-bnd-xmi-file – Synesso Apr 12 '11 at 07:08
  • Yes, you can change it for the EJB jars. The full list of deployable types that can be configured is documented at {base}\web\configDocs\packages\appdeployment\DeployedObject.html and includes EJBModuleDeployment – Synesso Apr 12 '11 at 07:51