5 Replies Latest reply on Sep 24, 2013 7:08 AM by arun168403

    Exception on Timer EJB

    arun168403

      I have a SLSB as below which implements Timer interface:

      public class EzSetupEJB
              implements javax.ejb.SessionBean
               
      {
        …….
        ….
      
        @Resource
        private TimerService timerService;
      
        public void onDeployment()
        {
        s_log.info("STARTUP SEQUENCE INVOKED");
         createTimer(1000, EzSetupTimerInfo.STATE_CREATENE, null);
        }
        protected void createTimer(long expiration, int ezSetupState,
         String userLabel)
        {
        s_log.info("CreateTimer invoked!");
        Timer t = timerService.createTimer(expiration,new String(""+ezSetupState));  
        
        }
        @Timeout
        @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
        public void checkStatus(Timer timer)
        {
         ……
        }
      
      
      }
      
      

      I’m trying to invoke the onDeployment() method from a remote client to initiate the timer. But I’m getting an exception as below:

       

      Could you kindly help on this:

       

      02:09:35,515 INFO [com.alcatel.trace] (EJB default - 1) STARTUP SEQUENCE INVOKED
      02:09:35,515 INFO [com.alcatel.trace] (EJB default - 1) CreateTimer invoked!
      01:33:43,343 INFO [org.jboss.as.naming] (Remoting "ocs" task-2) JBAS011806: Channel end notification received, closing channel Channel ID 1c619b9b (inbound) of Remoting connection 019ca39b to null
      01:33:44,343 ERROR [org.jboss.as.ejb3] (EJB default - 2) JBAS014120: Error invoking timeout for timer: [id=9367a316-db53-4e2b-a6ce-ee40e705deb8 timedObjectId=gem.ejb-jar-ezsetup.EzSetup auto-timer?:false persistent?:true timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@19ae4 initialExpiration=Thu Sep 19 01:33:44 BRT 2013 intervalDuration(in milli sec)=0 nextExpiration=null timerState=IN_TIMEOUT: java.lang.RuntimeException: JBAS014481: Cannot invoke timeout method because method null is not a timeout method
      at org.jboss.as.ejb3.timerservice.TimedObjectInvokerImpl.callTimeout(TimedObjectInvokerImpl.java:81) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
      at org.jboss.as.ejb3.timerservice.TimedObjectInvokerImpl.callTimeout(TimedObjectInvokerImpl.java:111) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
      at org.jboss.as.ejb3.timerservice.task.TimerTask.callTimeout(TimerTask.java:157) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
      at org.jboss.as.ejb3.timerservice.task.TimerTask.run(TimerTask.java:132) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_25]
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_25]
      at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_25]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
      at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
      at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.0.0.GA.jar:2.0.0.GA]
      
      01:33:44,343 INFO [org.jboss.as.ejb3] (EJB default - 2) JBAS014121: Timer: [id=9367a316-db53-4e2b-a6ce-ee40e705deb8 timedObjectId=gem.ejb-jar-ezsetup.EzSetup auto-timer?:false persistent?:true timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@19ae4 initialExpiration=Thu Sep 19 01:33:44 BRT 2013 intervalDuration(in milli sec)=0 nextExpiration=null timerState=IN_TIMEOUT will be retried
      01:33:44,343 INFO [org.jboss.as.ejb3] (EJB default - 2) JBAS014123: Retrying timeout for timer: [id=9367a316-db53-4e2b-a6ce-ee40e705deb8 timedObjectId=gem.ejb-jar-ezsetup.EzSetup auto-timer?:false persistent?:true timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@19ae4 initialExpiration=Thu Sep 19 01:33:44 BRT 2013 intervalDuration(in milli sec)=0 nextExpiration=null timerState=IN_TIMEOUT
      01:33:44,390 ERROR [org.jboss.as.ejb3] (EJB default - 2) JBAS014122: Error during retrying timeout for timer: [id=9367a316-db53-4e2b-a6ce-ee40e705deb8 timedObjectId=gem.ejb-jar-ezsetup.EzSetup auto-timer?:false persistent?:true timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@19ae4 initialExpiration=Thu Sep 19 01:33:44 BRT 2013 intervalDuration(in milli sec)=0 nextExpiration=null timerState=RETRY_TIMEOUT: java.lang.RuntimeException: JBAS014481: Cannot invoke timeout method because method null is not a timeout method
      at org.jboss.as.ejb3.timerservice.TimedObjectInvokerImpl.callTimeout(TimedObjectInvokerImpl.java:81) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
      at org.jboss.as.ejb3.timerservice.TimedObjectInvokerImpl.callTimeout(TimedObjectInvokerImpl.java:111) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
      at org.jboss.as.ejb3.timerservice.task.TimerTask.callTimeout(TimerTask.java:157) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
      at org.jboss.as.ejb3.timerservice.task.TimerTask.run(TimerTask.java:132) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_25]
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_25]
      at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_25]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
      at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
      at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.0.0.GA.jar:2.0.0.GA]
      
      
        • 1. Re: Exception on Timer EJB
          jaikiran

          What does your calling code look like and how is that EzSetupEJB configured as a EJB?

           

          Also, please try this against a later released version of JBoss AS7 or WildFly Downloads and see if it was a bug which might already have been fixed.

          • 2. Re: Re: Exception on Timer EJB
            arun168403

            Hi Jaikiran,

             

            yes.. my client is calling this as an EJB.

             

            final Hashtable jndiProperties = new Hashtable();
              jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory" );
              jndiProperties.put("jboss.naming.client.ejb.context", true);
              jndiProperties.put(Context.PROVIDER_URL, "remote://localhost:4447");
             jndiProperties.put(Context.SECURITY_PRINCIPAL, "arun");
             jndiProperties.put(Context.SECURITY_CREDENTIALS, "arun123");
             Context context = new InitialContext(jndiProperties);
             String jndi ="gem/ejb-jar-ezsetup/EzSetup!com.alcatel.gem.ezsetup.interfaces.EzSetup";
             EzSetup obj1 = (EzSetup)context.lookup(jndi);
             obj1.onDeployment();
            

            I'm using JBoss7.1.1 Final Version for development.

            • 3. Re: Exception on Timer EJB
              arun168403

              I tried to deploy on the 8.0.0 Alpha4. My CMP Beans are not deployed in the server.

              It stops deplyment with error "JBAS014588: CMP Entity Beans are not supported".

               

              Thanks,

              Arun

              • 4. Re: Exception on Timer EJB
                wdfink

                Support for EJB2 EntityBeans is removed from WildFly as it is marked as optional within the EJB specification for EE7.

                The latest version where EJB2/CMP is supported will be AS7 and EAP6.

                • 5. Re: Exception on Timer EJB
                  arun168403

                  thanks for the suggestion.

                  I have replaced the logic with wait().