-
1. Re: MDB class loading question
genman Sep 13, 2004 6:54 PM (in response to chuckharris)
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. -
2. Re: MDB class loading question
chuckharris Sep 13, 2004 11:41 PM (in response to chuckharris)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?
-
3. Re: MDB class loading question
genman Sep 14, 2004 11:51 PM (in response to chuckharris)
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.
http://www.huihoo.com/jboss/online_manual/3.0/ch13s72.html
Typically, one can only find out if a configuration works by trying it... -
4. Re: MDB class loading question
chuckharris Sep 15, 2004 7:45 PM (in response to chuckharris)Thanks for the help.
I followed the link:
http://www.huihoo.com/jboss/online_manual/3.0/ch13s72.html
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
http://www.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration
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? -
5. Re: MDB class loading question
genman Sep 15, 2004 9:56 PM (in response to chuckharris)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. -
6. Re: MDB class loading question
chuckharris Sep 16, 2004 6:50 PM (in response to chuckharris)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.