Nathan Mittler wrote:
Hi,
I'm fairly new to EJB and am trying understand the way classpaths work
in Geronimo with respect to MDBs. I have a pretty simple app - just
one MDB that consumes from JMS and writes to the database. It
requires a few jars (hibernate, spring, etc) and I bundle those
dependencies along with the MDB into an ear (using Maven) and then
deploy the whole app to Geronimo 1.1.
However, when the MDB receives JMS messages from AMQ, it doesn't seem
to be able to find any of the other classes in the EAR. I'm guessing
this is due to it being in the classloader of the AMQ connector,
rather than the ear upon invocation. I was able to fix this by
manually adding all of the dependencies to Geronimo's repository and
then listing those dependencies in the openejb-jar.xml. This seems to
do the trick.
My questions are:
1) Is there a better way to deploy a module along with all its
dependencies to Geronimo - rather than wrapping them up in an ear? A
tool perhaps?
2) Is there a more appropriate (and simpler) solution to the
classloader "problem" with MDBs? ( ... assuming I have diagnosed the
problem correctly)
//It could be that you are hitting a bug that should be fixed in the
upcoming 1.1.1 release (
//http://issues.apache.org/jira/browse/GERONIMO-2125 ). Also check you
are setting the "//Class-Path: entry"// in the META-INF///MANIFEST.MF
file in the JAR containing the MDB to point to the libraries (e.g.
hibernate) in the EAR (not that this will help you without the fix).
Also see the following mail threads related to the issue:
//http://www.mail-archive.com/[email protected]/msg03407.html
http://www.mail-archive.com/[email protected]/msg26669.html
Regards,
John
Thanks,
Nathan Mittler