2 Replies Latest reply on Jan 5, 2012 9:06 AM by Sarang Anajwala

    JBOSS EJB Timers, delete multiple copies.

    dsteel100 Newbie

       

       

       

       

      I have moved from GlassFish in the past couple of days and I am using JBoss 6 and JBoss Developer Studio (30 day trail) to see if this is the way to go. 

       

      I have created a Session Bean that is as follows:

       

      @Stateless
      @LocalBean
      public class FileMonitorTimer {


          @Schedule(second = "*/15", minute = "*", hour = "*", dayOfMonth = "*", month = "*", year = "*")
          public void ProcessFiles() {

              //do bits here
          }

       

      Every time I run the project from the IDE I get another timer instance created, so my questions are:

       

      How do I remove multiple timer copies?

      How do I ensure only one timer exists?

       

      I didn't have this issue with GlassFish, but the code is the same.

       

      Dave

        • 1. Re: JBOSS EJB Timers, delete multiple copies.
          jaikiran pai Master

          It's a bug we have in AS 6.x. We have that fixed in AS7.

           

          A workaround is to mark the @Schedule with persistent=false attribute. For already created timers, clean the JBOSS_HOME/server/<servername>/data folder (one time) before setting that persistent=false flag.

          • 2. Re: JBOSS EJB Timers, delete multiple copies.
            Sarang Anajwala Newbie

            Does this suggest that persistent timers are not stable in JBoss6.1GA?

            We are occassionally facing following errors while trying to trigger a timer (persistent and non-persistent both types):

            Any workarounds/solutions will be highly appreciated.

             

            javax.ejb.EJBException: javax.transaction.RollbackException: ARJUNA-16083 Can't register synchronization because the transaction is in aborted state

            ..................

            2012-01-05 03:03:36,876 WARN  [org.hibernate.util.JDBCExceptionReporter] (pool-11-thread-10) SQL Error: 0, SQLState: null

            2012-01-05 03:03:36,876 ERROR [org.hibernate.util.JDBCExceptionReporter] (pool-11-thread-10) Transaction is not active: tx=TransactionImple < ac, BasicAction: 0:ffff870a3d12:126a:4f0450a2:43 status: ActionStatus.ABORTED >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 0:ffff870a3d12:126a:4f0450a2:43 status: ActionStatus.ABORTED >)

            2012-01-05 03:03:36,878 ERROR [org.jboss.ejb3.tx2.impl.CMTTxInterceptor] (pool-11-thread-10) javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Cannot open connection