-
Bug
-
Resolution: Done
-
Major
-
None
-
None
-
None
We have an MDB which inside uses @EJB injection of stateless bean
@MessageDriven(name = "EJBExecutorMDB", activationConfig =
{ @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"), @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/ExecutorQueue"), @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "AUTO_ACKNOWLEDGE"), @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "4"), @ActivationConfigProperty(propertyName = "maxPoolSize", propertyValue = "4"), @ActivationConfigProperty(propertyName = "durability", propertyValue = "Durable") })
public class EJBExecutorMDB implements MessageListener {
@EJB
ProcessTrackInformationDAOLocal trackInfoAccess;
We have JMS queue with a lot of messages.
We start jboss and put EAR file to it. EAR begin to deploy and in that stage error occurs:
2006-03-01 10:26:23,081 ERROR [STDERR] javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: TrackInfoAccessLocal not bound]
2006-03-01 10:26:24,476 ERROR [STDERR] Caused by: javax.naming.NameNotFoundException: TrackInfoAccessLocal not bound
2006-03-01 10:26:25,325 ERROR [org.jboss.jms.asf.StdServerSession] session failed to run; setting rollback only
java.lang.RuntimeException: Unable to inject jndi dependency: env/be.certipost.jc.jbpm.jms.EJBExecutorMDB/trackInfoAccess into field be.certipost.jc.process.tracking.ejb.ProcessTrackInformationDAOLocal be.certipost.jc.jbpm.jms.EJBExecutorMDB.trackInfoAccess
at org.jboss.ejb3.injection.JndiFieldInjector.inject(JndiFieldInjector.java:74)
at org.jboss.ejb3.injection.JndiFieldInjector.inject(JndiFieldInjector.java:61)
at org.jboss.ejb3.AbstractPool.create(AbstractPool.java:88)
What I see in log file that Injected EJB deployed after MDB:
—
2006-03-01 10:26:22,540 INFO [org.jboss.ejb3.JmxKernelAbstraction] installing MBean: jboss.j2ee:service=EJB3,ear=CertiOne.ear,jar=CertiOne2.jar,name=EJBExecutorMDB with dependencies:
2006-03-01 10:26:23,047 INFO [org.jboss.ejb3.JmxKernelAbstraction] installing MBean: jboss.j2ee:service=EJB3,ear=CertiOne.ear,jar=CertiOne2.jar,name=AccessTrackInformationBean with dependencies:
2006-03-01 10:26:23,056 INFO [org.jboss.ejb3.JmxKernelAbstraction] persistence.units:ear=CertiOne.ear.ear,jar=CertiOne2.jar.jar,unitName=CertiOneCore
—
After some time ERROR messages disappear and messages are processed.
If we don't have messages in queue before deployment then deploy finishes without errors and if after deployment end we push JMS messages there is no ERROR messages in log file.
One of workarounds is to use @Depends annotation. But in that case name of EAR and jar file should be used. And if we change name of EAR in that case it will be a mess.
I think MDB shouldn't take message from queue until dependency check of injected objects is performed. And this dependency check should be done automatically by server itself.