If you have your .ear files bundled correctly you won't have class loading issues.
The MDB classes should be given different names (obviously). In your .ear put in a jboss-app.xml that defines a distinct class loader.
Thanks. Each mdb is a different class and listens on a different queue. Currently, I have the additional jars in each ear specified with a module tag in each application.xml. Will that do it?
Sorry. I didn't mean to say they have to be different names, they can be the same name. I don't know why I said that.
The stuff in application.xml should be services (.sar) ejb (.jar) and web apps (.war). The libraries get loaded from a classpath setting. There should be docs out there on setting this up.
Typically, one can only find out if a configuration works by trying it...
Thanks for the help.
I followed the link:
and added a Class-Path : \packages\jboss-3.2.5\server\default\test\jar1.jar \packages\jboss-3.2.5\server\default\test\jar2.jar to the meta-inf\manifest.mf
in the ejb jar. The ear deployed but did not process messages.
The queue count increased but there was never any processing or logging or
anything at all. Adding the classpath to the maniest in the ear caused
an error - no meta-inf/application.xml found even though it was present in the ear. I tried
and added a jboss-app.xml to the ear:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jboss-app PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss-app_3_0.dtd"> <jboss-app> <loader-repository> dot.com:loader=\packages\jboss-3.2.5\server\default\test\jar1.jar </loader-repository> </jboss-app>but I got class not found errors. With the above, I would need to add both jars
anyway. What do I need to do to get the test mdb to use the ../test/ jars
and the prod mdb to use the ../prod jars?
The loader configuration has to be a valid javax.management.ObjectName not a class path.
The classpath is configured through the META-INF/MANIFEST.MF file which is created as part of your EJB .jar file. The manifest is not part of the .ear.
Your ear should look like:
joe.ear joe.jar (ejb stuff) joe.sar (MBeans) lib/ apache-library.jar apache-library2.jar META-INF/ application.xml jboss.xml jboss-app.xml
Each .jar should have its own jboss.xml and ejb-jar.xml in META-INF.
Thanks for the help with this. I got sick of messing with it. I am now running two instances of jboss, one for test and one for prod. Seems to be running fine. Thanks again.