[jboss-jira] [JBoss JIRA] Commented: (JBAS-9424) MDB's are started *BEFORE* EJB's are jndi-bound
jaikiran pai (JIRA)
jira-events at lists.jboss.org
Fri Jul 29 09:41:24 EDT 2011
[ https://issues.jboss.org/browse/JBAS-9424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12617551#comment-12617551 ]
jaikiran pai commented on JBAS-9424:
------------------------------------
Please try against latest AS6 nightly build http://community.jboss.org/thread/161386. Also if that doesn't work, then please try using @EJB instead of @Inject.
> MDB's are started *BEFORE* EJB's are jndi-bound
> -----------------------------------------------
>
> Key: JBAS-9424
> URL: https://issues.jboss.org/browse/JBAS-9424
> Project: Legacy JBoss Application Server 6
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: EJB, Weld/CDI
> Affects Versions: 6.0.0.Final
> Environment: All (*NIX, Mac-Os-X and Win)
> Reporter: Bernard Ligny
> Assignee: Carlo de Wolf
> Priority: Critical
>
> I recently noticed a very strange behaviour (with JBOSS AS 6) with Message-Driven-Beans where we inject EJB.
> If the JMS queue is empty when the jboss server is started, then everything works fine.
> If, no luck, the jms queue is *NOT* empty, my MDB is apparently mounted *BEFORE* the ejb's
> and the @Inject failed:
> => "Failure WELD-000079 Could not find the EJB in JNDI: class xxx"
> I further investigated the problem:
> I replaced the @Inject annotation, with a "manual" lookup of my ejb
> using the javax.enterprise.inject.spi.BeanManager capabilities (that i put in a @Postcontruct method of my MDB),
> The trick consisted in trying the lookup n times with a delay of x sec between each attempt.
> Here are the results (excerpt from server.log):
> {code:xml}
> 2011-07-28 12:05:06,180 INFO [STDOUT] (Thread-0 (group:HornetQ-client-global-threads-183899831)) *** [1] Trying to lookup KernelResources
> 2011-07-28 12:05:06,190 INFO [STDOUT] (Thread-0 (group:HornetQ-client-global-threads-183899831)) *** [1] Failure WELD-000079 Could not find the EJB in JNDI: class net.haulogy.energycomm.kernel.org$jboss$weld$bean-jboss$classloader:id="vfs:$$$Users$bli$Devware$jboss-6$0$0$Dev$server$default$deploy$energycomm-ear$ear"-SessionBean-KernelResources_$$_WeldProxy
> ...
> 2011-07-28 12:05:11,191 INFO [STDOUT] (Thread-0 (group:HornetQ-client-global-threads-183899831)) *** [2] Trying to lookup KernelResources
> 2011-07-28 12:05:11,192 INFO [STDOUT] (Thread-0 (group:HornetQ-client-global-threads-183899831)) *** [2] Failure WELD-000079 Could not find the EJB in JNDI: class net.haulogy.energycomm.kernel.org$jboss$weld$bean-jboss$classloader:id="vfs:$$$Users$bli$Devware$jboss-6$0$0$Dev$server$default$deploy$energycomm-ear$ear"-SessionBean-KernelResources_$$_WeldProxy
> ...
> 2011-07-28 12:05:16,193 INFO [STDOUT] (Thread-0 (group:HornetQ-client-global-threads-183899831)) *** [3] Trying to lookup KernelResources
> 2011-07-28 12:05:16,193 INFO [STDOUT] (Thread-0 (group:HornetQ-client-global-threads-183899831)) *** [3] Failure WELD-000079 Could not find the EJB in JNDI: class net.haulogy.energycomm.kernel.org$jboss$weld$bean-jboss$classloader:id="vfs:$$$Users$bli$Devware$jboss-6$0$0$Dev$server$default$deploy$energycomm-ear$ear"-SessionBean-KernelResources_$$_WeldProxy
> ...
> 2011-07-28 12:05:21,194 INFO [STDOUT] (Thread-0 (group:HornetQ-client-global-threads-183899831)) *** [4] Trying to lookup KernelResources
> 2011-07-28 12:05:21,194 INFO [STDOUT] (Thread-0 (group:HornetQ-client-global-threads-183899831)) *** [4] Failure WELD-000079 Could not find the EJB in JNDI: class net.haulogy.energycomm.kernel.org$jboss$weld$bean-jboss$classloader:id="vfs:$$$Users$bli$Devware$jboss-6$0$0$Dev$server$default$deploy$energycomm-ear$ear"-SessionBean-KernelResources_$$_WeldProxy
> ...
> 2011-07-28 12:05:26,195 INFO [STDOUT] (Thread-0 (group:HornetQ-client-global-threads-183899831)) *** [5] Trying to lookup KernelResources
> 2011-07-28 12:05:26,195 INFO [STDOUT] (Thread-0 (group:HornetQ-client-global-threads-183899831)) *** [5] Failure WELD-000079 Could not find the EJB in JNDI: class net.haulogy.energycomm.kernel.org$jboss$weld$bean-jboss$classloader:id="vfs:$$$Users$bli$Devware$jboss-6$0$0$Dev$server$default$deploy$energycomm-ear$ear"-SessionBean-KernelResources_$$_WeldProxy
> ...
> 2011-07-28 12:05:26,215 INFO [org.jboss.ejb3.nointerface.impl.jndi.AbstractNoInterfaceViewBinder] (Thread-3) Binding the following entry in Global JNDI for bean:KernelResources
> => finally the EJB is bound !
> 2011-07-28 12:05:31,196 INFO [STDOUT] (Thread-0 (group:HornetQ-client-global-threads-183899831)) *** [6] Trying to lookup KernelResources
> 2011-07-28 12:05:31,197 INFO [STDOUT] (Thread-0 (group:HornetQ-client-global-threads-183899831)) *** KernelResources = No-Interface view for endpoint [ jboss.j2ee:ear=energycomm-ear.ear,jar=energycomm-kernel-0.5.0-SNAPSHOT.jar,name=KernelResources,service=EJB3 ]
> => the 6th attempt now works :-)
> {code}
> Conclusion: according to me, there is no doubt: dependencies between MDB's and EJB's are not correctly managed by the app server.
> The app server should wait for all EJB's to be bound before activating the MDB.
> MDB are activated too early (especially when jms queue is not empty at starttime)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list