8 Replies Latest reply on Mar 10, 2011 3:00 AM by jatindra.singhdeo

    EJB3 Timer and Dependency Injection

      I am working with Jboss 5.1. and I have simple  SLB with ejbTimer in it. This beans references the another SLSB thru dependency injection. But deploying this bean causes issues which I can't figure out. It seems that timer runs in different class loader than my code and hence can't find the dependency injection bean: I spend too much of time on it and I don't know what is going on. Any help on this is much Appreciated. Here is code and exception

       

       

       

      @Stateless

      @Local

       

      ({ReferenceDataObserverLocalInterface.class})

      @Remote

       

      ({ReferenceDataObserverRemoteInterface.class})

      //@Pool (value=PoolDefaults.POOL_IMPLEMENTATION_STRICTMAX, maxSize=1, timeout=10000)

      public

       

       

      implements ReferenceDataObserverRemoteInterface,ReferenceDataObserverLocalInterface

      {

       

       

      private static final Logger LOG = Logger.getLogger(ReferenceDataObserverBean.class);

       

       

      private @Resource SessionContext ctx;

       

      @EJB ReferenceDataServiceLocal refdata;

       

       

      public void addChangeListener(String account, Object o)

      {

      SerializedServiceMessage info =

      new SerializedServiceMessage(account, omsBlock);

       

      ctx.getTimerService().createTimer(30000,60000, info);

      }

       

       

       

       

      @Timeout

       

      public void timeoutHandler(Timer timer)

      {

      SerializedServiceMessage message = (SerializedServiceMessage)timer.getInfo();

       

       

      LOG.info("Timer notification received for " + timer.getInfo());

       

       

      if ( timer != null )

      {

      timer.cancel();

       

      LOG.info("Timer created for " + ntapAccts.toString() + " for Object " + message.source.toString());

      }

      }

       

      else

      {

       

      LOG.info("Time out called but the map is null");

      }

       

       

      }

       

       

      static class SerializedServiceMessage implements Serializable

      {

       

      private static final long serialVersionUID = 1L;

       

      String

      account;

      Object

      source;

      SerializedServiceMessage(String account, Object source)

      {

       

      this.account = account;

       

      this.source = source;

      }

      }

      }

       

      ------------------------------------------------------

       

      exception:

      2009-12-18 12:35:07,918 ERROR [EJB-Timer-1261157694169[target=jboss.j2ee:ear=Mob.ear,jar=mob-business.jar,name=ReferenceDataObserverBean,service=EJB3]] [org.jboss.ejb.txtimer.TimerImpl] Error invoking ejbTimeout
      javax.ejb.EJBException: java.lang.RuntimeException: Unable to inject jndi dependency: env/com.lotus.mob.services.booking.ReferenceDataObserverBean/mobAllocationBeanInterface into property com.lotus.mob.services.booking.ReferenceDataObserverBean.mobAllocationBeanInterface: com.lotus.mob.database.service.beans.interfaces.ReferenceDataServiceLocal  from BaseClassLoader@710713de{VFSClassLoaderPolicy@7a98dcb{name=vfsfile:/opt/equity/mob/applications/application_server/jboss-5.1.0.GA/server/mob/deploy/ejb2-timer-service.xml domain=ClassLoaderDomain@3219ee8a{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@74341960} roots=[MemoryContextHandler@211553883[path= context=vfsmemory://432d4h2j-bmdr5q-g3d8pnt8-1-g3d8q0d9-w real=vfsmemory://432d4h2j-bmdr5q-g3d8pnt8-1-g3d8q0d9-w]]  delegates=null exported=[] <IMPORT-ALL>NON_EMPTY}}
          at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:77)
          at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
          at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:80)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.ejb3.stateless.StatelessContainer.callTimeout(StatelessContainer.java:266)
          at org.jboss.as.ejb3.timerservice.TimedObjectInvokerBridge.callTimeout(TimedObjectInvokerBridge.java:44)
          at org.jboss.ejb.txtimer.TimerImpl$TimerTaskImpl.run(TimerImpl.java:561)
          at java.util.TimerThread.mainLoop(Timer.java:512)
          at java.util.TimerThread.run(Timer.java:462)
      Caused by: java.lang.RuntimeException: Unable to inject jndi dependency: env/com.lotus.mob.services.booking.ReferenceDataObserverBean/refData into property com.lotus.mob.services.booking.ReferenceDataObserverBean.ReferenceDataService: com.lotus.mob.database.service.beans.interfaces.ReferenceDataServiceLocal  from BaseClassLoader@710713de{VFSClassLoaderPolicy@7a98dcb{name=vfsfile:/opt/equity/mob/applications/application_server/jboss-5.1.0.GA/server/mob/deploy/ejb2-timer-service.xml domain=ClassLoaderDomain@3219ee8a{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@74341960} roots=[MemoryContextHandler@211553883[path= context=vfsmemory://432d4h2j-bmdr5q-g3d8pnt8-1-g3d8q0d9-w real=vfsmemory://432d4h2j-bmdr5q-g3d8pnt8-1-g3d8q0d9-w]]  delegates=null exported=[] <IMPORT-ALL>NON_EMPTY}}
      at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:99)
          at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:89)
          at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:61)
          at org.jboss.ejb3.injection.InjectionInvocation.invokeTarget(InjectionInvocation.java:89)
          at org.jboss.ejb3.injection.InjectionInvocation.invokeNext(InjectionInvocation.java:83)
          at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
          at org.jboss.ejb3.injection.InjectionInvocation.invokeNext(InjectionInvocation.java:74)
          at org.jboss.ejb3.EJBContainer.injectBeanContext(EJBContainer.java:1138)
          at org.jboss.ejb3.pool.AbstractPool.create(AbstractPool.java:83)
          at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:56)
          at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:51)
          at org.jboss.ejb3.pool.ThreadlocalPool.create(ThreadlocalPool.java:52)
          at org.jboss.ejb3.pool.ThreadlocalPool.get(ThreadlocalPool.java:92)
          at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:58)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
          ... 19 more
      Caused by: javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NamingException: Could not dereference object [Root exception is java.lang.RuntimeException: Can not find interface declared by Proxy in our CL + BaseClassLoader@710713de{vfsfile:/opt/equity/mob/applications/application_server/jboss-5.1.0.GA/server/mob/deploy/ejb2-timer-service.xml}]]
          at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1352)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:817)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
          at org.jboss.ejb3.JndiUtil.lookup(JndiUtil.java:44)
          at org.jboss.injection.JndiPropertyInjector.lookup(JndiPropertyInjector.java:75)
          ... 35 more
      Caused by: javax.naming.NamingException: Could not dereference object [Root exception is java.lang.RuntimeException: Can not find interface declared by Proxy in our CL + BaseClassLoader@710713de{vfsfile:/opt/equity/mob/applications/application_server/jboss-5.1.0.GA/server/mob/deploy/ejb2-timer-service.xml}]
          at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1504)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:822)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
          at javax.naming.InitialContext.lookup(InitialContext.java:392)
          at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1346)
          ... 39 more
      Caused by: java.lang.RuntimeException: Can not find interface declared by Proxy in our CL + BaseClassLoader@710713de{vfsfile:/opt/equity/mob/applications/application_server/jboss-5.1.0.GA/server/mob/deploy/ejb2-timer-service.xml}
          at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.redefineProxyInTcl(ProxyObjectFactory.java:410)
          at org.jboss.ejb3.proxy.impl.objectfactory.session.SessionProxyObjectFactory.createProxy(SessionProxyObjectFactory.java:134)
          at org.jboss.ejb3.proxy.impl.objectfactory.session.stateless.StatelessSessionProxyObjectFactory.getProxy(StatelessSessionProxyObjectFactory.java:79)
          at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:161)

      Caused by: java.lang.RuntimeException: Can not find interface declared by Proxy in our CL + BaseClassLoader@710713de{vfsfile:/opt/equity/mob/applications/application_server/jboss-5.1.0.GA/server/mob/deploy/ejb2-timer-service.xml}
          at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.redefineProxyInTcl(ProxyObjectFactory.java:410)
          at org.jboss.ejb3.proxy.impl.objectfactory.session.SessionProxyObjectFactory.createProxy(SessionProxyObjectFactory.java:134)
          at org.jboss.ejb3.proxy.impl.objectfactory.session.stateless.StatelessSessionProxyObjectFactory.getProxy(StatelessSessionProxyObjectFactory.java:79)
          at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:161)
          at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
          at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1479)
          at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1496)
          ... 43 more
      Caused by: java.lang.ClassNotFoundException: com.lotus.mob.database.service.beans.interfaces.ReferenceDataServiceLocal  from BaseClassLoader@710713de{VFSClassLoaderPolicy@7a98dcb{name=vfsfile:/opt/equity/mob/applications/application_server/jboss-5.1.0.GA/server/mob/deploy/ejb2-timer-service.xml domain=ClassLoaderDomain@3219ee8a{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@74341960} roots=[MemoryContextHandler@211553883[path= context=vfsmemory://432d4h2j-bmdr5q-g3d8pnt8-1-g3d8q0d9-w real=vfsmemory://432d4h2j-bmdr5q-g3d8pnt8-1-g3d8q0d9-w]]  delegates=null exported=[] <IMPORT-ALL>NON_EMPTY}}
          at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:448)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
          at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Class.java:247)
          at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.redefineProxyInTcl(ProxyObjectFactory.java:406)
          ... 49 more

       

      class ReferenceDataObserverBean

       

        • 1. Re: EJB3 Timer and Dependency Injection
          jaikiran
          Try our latest EJB3 plugin http://www.jboss.org/ejb3/ejb3plugin.html against AS-5.1.0.

          The latest download is available here http://www.jboss.org/ejb3/downloads.html

          If the latest plugin too doesn't solve your issue then please post the entire details.
          • 2. Re: EJB3 Timer and Dependency Injection
            nfisk
            Okay, I'll bite. I have the same problem, I have installed your JBoss plugin, and it didn't change anything. I assume what's happening is that the timer service runs before my app is fully deployed. Does this sound reasonable, and if so, can it be delayed somehow?
            • 3. Re: EJB3 Timer and Dependency Injection
              jaikiran

              nfisk wrote:

               

              I assume what's happening is that the timer service runs before my app is fully deployed. Does this sound reasonable, and if so, can it be delayed somehow?

              Yes, that's what was fixed.

               

              nfisk wrote:

               

              Okay, I'll bite. I have the same problem, I have installed your JBoss plugin, and it didn't change anything.

              Which version of the plugin did you install? And please post the entire exception stacktrace.

              • 4. Re: EJB3 Timer and Dependency Injection
                nfisk

                Wow, quick answer -- thanks! I installed jboss-ejb3-plugin-1.0.19-installer.jar. Stack trace is as follows. Any further input would be really appreciated.

                 

                20:14:26,096 ERROR [TimerImpl] Error invoking ejbTimeout

                javax.ejb.EJBException: java.lang.RuntimeException: Unable to inject jndi dependency: env/com.example.app.facade.qasession.QASessionFacadeBean/voteTopic into property com.example.app.facade.qasession.QASessionFacadeBean.voteTopic: VoteTopic not bound

                        at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:77)

                        at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)

                        at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)

                        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                        at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)

                        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                        at org.jboss.ejb3.security.RunAsSecurityInterceptorv2.invoke(RunAsSecurityInterceptorv2.java:94)

                        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                        at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorv2.invoke(RoleBasedAuthorizationInterceptorv2.java:138)

                        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                        at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:80)

                        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                        at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)

                        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                        at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)

                        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                        at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)

                        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                        at org.jboss.ejb3.stateless.StatelessContainer.callTimeout(StatelessContainer.java:266)

                        at org.jboss.as.ejb3.timerservice.TimedObjectInvokerBridge.callTimeout(TimedObjectInvokerBridge.java:44)

                        at org.jboss.ejb.txtimer.TimerImpl$TimerTaskImpl.run(TimerImpl.java:561)

                        at java.util.TimerThread.mainLoop(Timer.java:512)

                        at java.util.TimerThread.run(Timer.java:462)

                Caused by: java.lang.RuntimeException: Unable to inject jndi dependency: env/com.example.app.facade.qasession.QASessionFacadeBean/voteTopic into property com.example.app.facade.qasession.QASessionFacadeBean.voteTopic: VoteTopic not bound

                        at org.jboss.injection.JndiPropertyInjector.lookup(JndiPropertyInjector.java:82)

                        at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:99)

                        at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:89)

                        at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:61)

                        at org.jboss.ejb3.injection.InjectionInvocation.invokeTarget(InjectionInvocation.java:89)

                        at org.jboss.ejb3.injection.InjectionInvocation.invokeNext(InjectionInvocation.java:83)

                        at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)

                        at org.jboss.ejb3.injection.InjectionInvocation.invokeNext(InjectionInvocation.java:74)

                        at org.jboss.ejb3.EJBContainer.injectBeanContext(EJBContainer.java:1138)

                        at org.jboss.ejb3.pool.AbstractPool.create(AbstractPool.java:83)

                        at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:56)

                        at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:51)

                        at org.jboss.ejb3.pool.ThreadlocalPool.create(ThreadlocalPool.java:52)

                        at org.jboss.ejb3.pool.ThreadlocalPool.get(ThreadlocalPool.java:92)

                        at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:58)

                        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                        at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)

                        ... 21 more

                Caused by: javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: VoteTopic not bound]

                        at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1352)

                        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:817)

                        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)

                        at org.jboss.ejb3.JndiUtil.lookup(JndiUtil.java:44)

                        at org.jboss.injection.JndiPropertyInjector.lookup(JndiPropertyInjector.java:75)

                        ... 37 more

                Caused by: javax.naming.NameNotFoundException: VoteTopic not bound

                        at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)

                        at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)

                        at org.jnp.server.NamingServer.getObject(NamingServer.java:785)

                        at org.jnp.server.NamingServer.lookup(NamingServer.java:443)

                        at org.jnp.server.NamingServer.lookup(NamingServer.java:399)

                        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)

                        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)

                        at javax.naming.InitialContext.lookup(InitialContext.java:392)

                        at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1346)

                        ... 41 more

                • 5. Re: EJB3 Timer and Dependency Injection
                  jaikiran

                  nfisk wrote:

                   

                  Wow, quick answer -- thanks! I installed jboss-ejb3-plugin-1.0.19-installer.jar. Stack trace is as follows. Any further input would be really appreciated.

                   

                  20:14:26,096 ERROR [TimerImpl] Error invoking ejbTimeout

                  javax.ejb.EJBException: java.lang.RuntimeException: Unable to inject jndi dependency: env/com.example.app.facade.qasession.QASessionFacadeBean/voteTopic into property com.example.app.facade.qasession.QASessionFacadeBean.voteTopic: VoteTopic not bound

                          at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:77)

                          at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)

                          at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)

                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                          at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)

                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                          at org.jboss.ejb3.security.RunAsSecurityInterceptorv2.invoke(RunAsSecurityInterceptorv2.java:94)

                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                          at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorv2.invoke(RoleBasedAuthorizationInterceptorv2.java:138)

                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                          at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:80)

                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                          at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)

                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                          at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)

                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                          at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)

                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                          at org.jboss.ejb3.stateless.StatelessContainer.callTimeout(StatelessContainer.java:266)

                          at org.jboss.as.ejb3.timerservice.TimedObjectInvokerBridge.callTimeout(TimedObjectInvokerBridge.java:44)

                          at org.jboss.ejb.txtimer.TimerImpl$TimerTaskImpl.run(TimerImpl.java:561)

                          at java.util.TimerThread.mainLoop(Timer.java:512)

                          at java.util.TimerThread.run(Timer.java:462)

                  Caused by: java.lang.RuntimeException: Unable to inject jndi dependency: env/com.example.app.facade.qasession.QASessionFacadeBean/voteTopic into property com.example.app.facade.qasession.QASessionFacadeBean.voteTopic: VoteTopic not bound

                   


                  This is a different issue. Infact, this is a configuration problem. You seem to be injecting a JMS topic into a bean and the topic is not yet deployed. Add a @Depends on the bean to depend on this topic. This will ensure that the bean gets deployed after the topic. See an example here and the tutorials here

                  • 6. Re: EJB3 Timer and Dependency Injection
                    nfisk

                    Thanks, that was it!

                     

                    I tried to figure out how to mark your reply "correct" and/or "helpful," thus hoping to at least give you some karma or whatever this site uses in return for your help, but couldn't find anything. May you live long and prosper anyway.

                    • 7. Re: EJB3 Timer and Dependency Injection
                      jaikiran
                      Glad to know it worked
                      • 8. EJB3 Timer and Dependency Injection
                        jatindra.singhdeo

                        Hi tried the solution it worked but ended up on another issue.Now the entity manager is getting injected as null as the persistent unit is getting created after the my timer service is invoked