5 Replies Latest reply on Jun 11, 2015 2:43 PM by wdfink

    EJBComponentUnavailableException: JBAS014559: Invocation cannot proceed as component is shutting down

    sachin.dhingra

      I have a requirement where i have some persistent timer in my application which will get activated during startup and when I stop the application from admin console or CLI, I have to kill/stop those timers.

       

      For that what I have done is:

        1. Created a applistener which implements the ServletContextListener.

        2. In the applistener class, I have overridden the contextDestroyed method in which i am calling Timer Beans to stop/Kill the active timers.

       

      Below is the entry in web.xml file:

      <listener>
          <listener-class>com.xxx.yyyserver.listener.ApplicationListener</listener-class>
        </listener>
      

       

      This listener is in my web project (.war) and timer is in EJB project (.jar) and both bundled in single ear file.

       

      This was working when app is on Websphere but same is not working in JBOSS EAP 6.1.0.

       

      What is happening here is when application is stopped from admin-console then it deploys the Timer beans before it reaches the contextDestroyed method of appListener class and it thorws below exception:

      org.jboss.as.ejb3.component.EJBComponentUnavailableException: JBAS014559: Invocation cannot proceed as component is shutting down
                      at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:59)
                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
                      at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)
                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
                      at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
                      at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55)
                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
                      at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
                      at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
                      at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165)
                      at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182)
                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
                      at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
                      at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72)
                      at com.xxx.yyyserver.commons.IDirListenerTimerServiceLocal$$$view11.killTimer(Unknown Source)
                      at com.xxx.yyyserver.commons.xxxValidator.stopAllTimers(xxxValidator.java:292)
      
      

       

      I am not sure what to do to stop/kill the active timers as these are persistent timers and will keep on running.

        • 1. Re: EJBComponentUnavailableException: JBAS014559: Invocation cannot proceed as component is shutting down
          sachin.dhingra

          Does any one knows anything about this?

          • 2. Re: EJBComponentUnavailableException: JBAS014559: Invocation cannot proceed as component is shutting down
            wdfink

            I don't understand what you try to achieve.

            I would use a @Singleton @Startup with @Postcreate and @predestroy.

            But why you need persistent timers if you stop it if you shutdown?

            Maybe a non persistent timer will do the job, you can initialisize it with a @Singleton @Startup Postcreate

             

            Does that make sense?

            • 3. Re: EJBComponentUnavailableException: JBAS014559: Invocation cannot proceed as component is shutting down
              sachin.dhingra

              Thanks Wolf, as when we wrote the code we were using JAVA EE5 which doesn't have the concept of non-persistent timer. As now we are upgrading to JAVA EE6, your suggestion is correct we can use non-persistent timer.

              • 4. Re: EJBComponentUnavailableException: JBAS014559: Invocation cannot proceed as component is shutting down
                kskandala

                Hi,

                 

                   We are using java util timer to trigger ejb. We are getting this exception even when we are not deploying/un-deploying any applications. We are on Jboss6.2 (Domain mode)

                Please share if any work around or fixed version of any jar to address this issue.

                 

                07:30:00,008 ERROR [com.ABCCorp.batch.process.tasks.CheckTask] (Timer-17) CheckTask Batch exception: : org.jboss.as.ejb3.component.EJBComponentUnavailableException: JBAS014559: Invocation cannot proceed as component is shutting down

                at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:59) [jboss-as-ejb3-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]

                at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]

                at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]

                at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55) [jboss-as-ejb3-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]

                at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]

                at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]

                at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

                at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182) [jboss-as-ee-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]

                at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]

                at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72) [jboss-as-ee-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

                at com.ABCCorp.business.refundprocessing.CheckTaskLocal$$$view39.logAlertsUnrefundedPayments(Unknown Source)

                at com.ABCCorp.batch.process.tasks.CheckTask.process(CheckTask.java:39) [XYZ-batch-process.jar:YYY]

                at com.ABCCorp.batch.service.SchedulerTask.run(SchedulerTask.java:65) [XYZ-batch-service.jar:YYY]

                at com.ABCCorp.batch.service.Scheduler$SchedulerTimerTask.run(Scheduler.java:34) [XYZ-batch-service.jar:YYY]

                at java.util.TimerThread.mainLoop(Timer.java:555) [rt.jar:1.7.0_40]

                at java.util.TimerThread.run(Timer.java:505) [rt.jar:1.7.0_40]

                • 5. Re: EJBComponentUnavailableException: JBAS014559: Invocation cannot proceed as component is shutting down
                  wdfink

                  Kiran,

                   

                  as this is a different issue as the original post, could you please create a new discussion and provide more information how you access the timer and where do you use it.

                  It seems that you use threads inside of the server which is a spec violation.