0 Replies Latest reply on Jun 2, 2010 1:30 PM by Jean Baldessar

    Timer problem

    Jean Baldessar Newbie

      I'm using Jboss 4.2.3 and am trying to make simple timer service but I am getting this stackTrace:

       

      14:02:48,135 WARN  [loggerI18N] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] Adding multiple last resources is disallowed. Current resource is org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@139fb49
      14:02:48,145 ERROR [STDERR] javax.ejb.EJBException: Failed to create timer
      14:02:48,146 ERROR [STDERR]     at org.jboss.ejb.txtimer.TimerServiceImpl.createTimer(TimerServiceImpl.java:262)
      14:02:48,146 ERROR [STDERR]     at org.jboss.ejb.txtimer.TimerServiceImpl.createTimer(TimerServiceImpl.java:171)
      14:02:48,146 ERROR [STDERR]     at org.jboss.ejb3.timerservice.jboss.TimerServiceFacade.createTimer(TimerServiceFacade.java:71)
      14:02:48,146 ERROR [STDERR]     at br.com.projedata.initium.avaliacao.core.business.bo.TarefaAvaliaBO.agendarFinalizacao(TarefaAvaliaBO.java:140)
      14:02:48,146 ERROR [STDERR]     at br.com.projedata.initium.avaliacao.core.business.bo.TarefaAvaliaBO.iniciar(TarefaAvaliaBO.java:123)
      14:02:48,146 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      14:02:48,146 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      14:02:48,147 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      14:02:48,147 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Unknown Source)
      14:02:48,147 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
      14:02:48,147 ERROR [STDERR]     at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
      14:02:48,147 ERROR [STDERR]     at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
      14:02:48,147 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      14:02:48,147 ERROR [STDERR]     at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
      14:02:48,147 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      14:02:48,147 ERROR [STDERR]     at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
      14:02:48,147 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      14:02:48,147 ERROR [STDERR]     at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
      14:02:48,147 ERROR [STDERR]     at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
      14:02:48,147 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      14:02:48,147 ERROR [STDERR]     at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
      14:02:48,147 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      14:02:48,147 ERROR [STDERR]     at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
      14:02:48,147 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      14:02:48,147 ERROR [STDERR]     at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
      14:02:48,147 ERROR [STDERR]     at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
      14:02:48,147 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      14:02:48,148 ERROR [STDERR]     at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
      14:02:48,148 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      14:02:48,148 ERROR [STDERR]     at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
      14:02:48,148 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      14:02:48,148 ERROR [STDERR]     at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:240)
      14:02:48,148 ERROR [STDERR]     at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:210)
      14:02:48,148 ERROR [STDERR]     at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:84)
      14:02:48,148 ERROR [STDERR]     at $Proxy1778.iniciar(Unknown Source)
      14:02:48,148 ERROR [STDERR]     at br.com.projedata.initium.avaliacao.view.web.backing.Pava005Back.selecionarAvaliacao(Pava005Back.java:54)
      14:02:48,148 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      14:02:48,148 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      14:02:48,148 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      14:02:48,148 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Unknown Source)
      14:02:48,148 ERROR [STDERR]     at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
      14:02:48,148 ERROR [STDERR]     at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
      14:02:48,148 ERROR [STDERR]     at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
      14:02:48,148 ERROR [STDERR]     at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
      14:02:48,148 ERROR [STDERR]     at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
      14:02:48,148 ERROR [STDERR]     at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
      14:02:48,148 ERROR [STDERR]     at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
      14:02:48,152 ERROR [STDERR]     at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
      14:02:48,153 ERROR [STDERR]     at br.com.projedata.initium.view.web.util.ExceptionHandler.processAction(ExceptionHandler.java:31)
      14:02:48,153 ERROR [STDERR]     at javax.faces.component.UICommand.broadcast(UICommand.java:387)
      14:02:48,153 ERROR [STDERR]     at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:55)
      14:02:48,153 ERROR [STDERR]     at org.ajax4jsf.component.UIDataAdaptor.broadcast(UIDataAdaptor.java:1364)
      14:02:48,153 ERROR [STDERR]     at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
      14:02:48,153 ERROR [STDERR]     at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
      14:02:48,153 ERROR [STDERR]     at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
      14:02:48,153 ERROR [STDERR]     at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
      14:02:48,153 ERROR [STDERR]     at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
      14:02:48,153 ERROR [STDERR]     at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
      14:02:48,153 ERROR [STDERR]     at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
      14:02:48,153 ERROR [STDERR]     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
      14:02:48,153 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      14:02:48,153 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      14:02:48,153 ERROR [STDERR]     at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
      14:02:48,153 ERROR [STDERR]     at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
      14:02:48,153 ERROR [STDERR]     at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
      14:02:48,153 ERROR [STDERR]     at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
      14:02:48,153 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      14:02:48,153 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      14:02:48,153 ERROR [STDERR]     at br.com.projedata.view.web.filter.CompressionFilter.doFilter(CompressionFilter.java:35)
      14:02:48,154 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      14:02:48,154 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      14:02:48,154 ERROR [STDERR]     at br.com.projedata.initium.view.web.auth.AccessFilter.doFilter(AccessFilter.java:70)
      14:02:48,154 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      14:02:48,154 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      14:02:48,154 ERROR [STDERR]     at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      14:02:48,154 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      14:02:48,154 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      14:02:48,154 ERROR [STDERR]     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      14:02:48,154 ERROR [STDERR]     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      14:02:48,154 ERROR [STDERR]     at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
      14:02:48,154 ERROR [STDERR]     at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      14:02:48,154 ERROR [STDERR]     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      14:02:48,154 ERROR [STDERR]     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      14:02:48,154 ERROR [STDERR]     at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      14:02:48,154 ERROR [STDERR]     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      14:02:48,154 ERROR [STDERR]     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      14:02:48,154 ERROR [STDERR]     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      14:02:48,154 ERROR [STDERR]     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      14:02:48,154 ERROR [STDERR]     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      14:02:48,155 ERROR [STDERR]     at java.lang.Thread.run(Unknown Source)
      14:02:48,155 ERROR [STDERR] Caused by: java.lang.IllegalStateException: Unable to persist timer
      14:02:48,155 ERROR [STDERR]     at org.jboss.ejb.txtimer.DatabasePersistencePolicy.insertTimer(DatabasePersistencePolicy.java:124)
      14:02:48,155 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      14:02:48,155 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      14:02:48,155 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      14:02:48,155 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Unknown Source)
      14:02:48,155 ERROR [STDERR]     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      14:02:48,155 ERROR [STDERR]     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      14:02:48,155 ERROR [STDERR]     at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      14:02:48,156 ERROR [STDERR]     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      14:02:48,156 ERROR [STDERR]     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      14:02:48,156 ERROR [STDERR]     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      14:02:48,156 ERROR [STDERR]     at $Proxy30.insertTimer(Unknown Source)
      14:02:48,156 ERROR [STDERR]     at org.jboss.ejb.txtimer.TimerServiceImpl.createTimer(TimerServiceImpl.java:256)
      14:02:48,156 ERROR [STDERR]     ... 89 more
      14:02:48,156 ERROR [STDERR] Caused by: org.jboss.util.NestedSQLException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -3f57f5eb:c888:4c068e11:8c status: ActionStatus.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -3f57f5eb:c888:4c068e11:8c status: ActionStatus.ABORT_ONLY >))
      14:02:48,156 ERROR [STDERR]     at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95)
      14:02:48,156 ERROR [STDERR]     at org.jboss.ejb.txtimer.GeneralPurposeDatabasePersistencePlugin.insertTimer(GeneralPurposeDatabasePersistencePlugin.java:199)
      14:02:48,156 ERROR [STDERR]     at org.jboss.ejb.txtimer.DatabasePersistencePolicy.insertTimer(DatabasePersistencePolicy.java:120)
      14:02:48,156 ERROR [STDERR]     ... 101 more
      14:02:48,157 ERROR [STDERR] Caused by: org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -3f57f5eb:c888:4c068e11:8c status: ActionStatus.ABORT_ONLY >)
      14:02:48,157 ERROR [STDERR]     at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:358)
      14:02:48,157 ERROR [STDERR]     at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:524)
      14:02:48,157 ERROR [STDERR]     at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:405)
      14:02:48,157 ERROR [STDERR]     at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:849)
      14:02:48,157 ERROR [STDERR]     at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
      14:02:48,157 ERROR [STDERR]     ... 103 more
      14:02:48,158 ERROR [STDERR] Caused by: javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -3f57f5eb:c888:4c068e11:8c status: ActionStatus.ABORT_ONLY >
      14:02:48,158 ERROR [STDERR]     at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.checkEnlisted(TxConnectionManager.java:759)
      14:02:48,158 ERROR [STDERR]     at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:592)
      14:02:48,158 ERROR [STDERR]     at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:352)
      14:02:48,158 ERROR [STDERR]     ... 107 more

       

       

       

       

      whats wrong?

      I'm making a realy simples timer:

       

       

      @Resource
           private TimerService timerService;
          
           @Override
           @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
           public void agendarFinalizacao(TarefaAvaliaEntity avaliacaoSelecionada, Integer tempo) {
               timerService.createTimer(tempo*60*1000, avaliacaoSelecionada);
           }
          
           @Timeout
           public void finalizarPorTimeout(Timer timer) {
               try {
                   TarefaAvaliaEntity avaliacao = (TarefaAvaliaEntity) timer.getInfo();
                   finalizar(avaliacao);
               } catch (Exception e) {
                   throw new RuntimeException(e);
               }
           }

       

       

      thaks