3 Replies Latest reply on Jun 17, 2008 2:13 AM by Bernhard Hurzeler

    MDB's activated too early

    Bradley Smith Master

      Hello,

      I have an EJB3-Seam application that uses's an MDB. A problem I am having is that as EJB deployer (I think) is activating or putting my MDB's into the Method-Ready Pool before my EAR is completely deployed. Is there a setting to control this?

      I am attempting to use Seam annotations on the MDB and I am getting the following exception upon deployment of my EAR:

      2007-02-07 11:23:38,705 ERROR [org.jboss.jms.asf.StdServerSession] session failed to run; setting rollback only
      java.lang.RuntimeException: java.lang.IllegalStateException: Attempted to invoke a Seam component outside the context of a web application
       at org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.postConstruct(LifecycleInterceptorHandler.java:109)
       at org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:582)
       at org.jboss.ejb3.AbstractPool.create(AbstractPool.java:108)
       at org.jboss.ejb3.ThreadlocalPool.get(ThreadlocalPool.java:48)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:54)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.mdb.MDB.localInvoke(MDB.java:865)
       at org.jboss.ejb3.mdb.MDB.localInvoke(MDB.java:844)
       at org.jboss.ejb3.mdb.MDB$MessageListenerImpl.onMessage(MDB.java:1074)
       at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:266)
       at progress.message.jimpl.Session.dU_(Unknown Source)
       at progress.message.jimpl.Session.run(Unknown Source)
       at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:196)
       at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.IllegalStateException: Attempted to invoke a Seam component outside the context of a web application
       at org.jboss.seam.contexts.Lifecycle.getServletContext(Lifecycle.java:413)
       at org.jboss.seam.contexts.Lifecycle.beginApplication(Lifecycle.java:89)
       at org.jboss.seam.Seam.componentForName(Seam.java:228)
       at org.jboss.seam.intercept.SessionBeanInterceptor.postConstruct(SessionBeanInterceptor.java:101)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.ejb3.interceptor.LifecycleInvocationContextImpl.proceed(LifecycleInvocationContextImpl.java:131)
       at org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.postConstruct(LifecycleInterceptorHandler.java:105)
       ... 14 more
      


      Thanks,
      Brad Smith