I'm having a ton of problems with deploying my ear file which contains a MDB when the queue that it is receiving messages from already contains messages. I'm trying to simulate a scenario if a machine crashes while there are still messages in the queue. I'm using the JDBC2 persistence manager to an oracle 9i DB. The error I'm getting is NoClassDefFound exception on one of the classes that my ejb uses. (The class that can't be found is indeed in a jar file contained within the ear file). It only throws the NoClassDefFound error if the queue contains messages BEFORE the ear is deployed. It will deploy just fine if there are no messages, and then consume any messages that are added to the Queue AFTER it has already been deployed.
It almost seems like JBoss is starting to let the MDB consume the messages before the ear is fully deployed. This seems like a fairly significant bug in JBoss and I'm not sure how to work around it, or if there is a workaround.
Does anyone have any ideas, thoughts, comments?
Which version are you using?
The use of dependencies in jboss.xml to solve these
kind issues has been discussed in the passed. e.g.
Your MDB uses beans in a different jar you can place
a dependency on the EJB module or EJB container
using the jmx object name starting with jboss.j2ee: