7 Replies Latest reply on Apr 4, 2009 11:07 AM by henk de boer

    TIMER SERVICE EJB 3.0 - Need Help

    Pramod Upadhyay Newbie

      Hi ALL,
      I am new to EJB 3.0. I have requirement to read data from webservice after every 5 min. So I had written Timer service. Inside Timer service code i am kicking stateless session bean method.

      I deployed this code on JBOSS 4.2.1 AS. But timer service is not starting.
      I am sure i am missing modification to some of configuration xml files......

      Please advice suggests ...what i can do to make my code working.....
      Thanks in advance

      pram

        • 1. Re: TIMER SERVICE EJB 3.0 - Need Help
          jaikiran pai Master

           

          So I had written Timer service.


          How did you do that? Please post the appropriate configuration files and code.

          While posting logs or xml content or code, please remember to wrap it in a code block by using the Code button in the message editor window. Please use the Preview button to ensure that your post is correctly formatted.


          • 2. Re: TIMER SERVICE EJB 3.0 - Need Help
            Pramod Upadhyay Newbie

            Jai,

            My Timer bean code is


            
            /**
             * Timer bean used to periodically search to see if any pager forward requests have been entered.
             *
             * @jboss.container-configuration name="Singleton oncall Standard Stateless SessionBean"
             *
             *
             */
            
            
            
            @Stateless(mappedName="ejb/OnCallTimerBean")
            @Remote(OnCallTimer.class)
            @Local(OnCallTimer.class)
            public class OnCallTimerBean implements OnCallTimer {
            
            
            
             /**
             * use for logging
             */
             Log log = LogFactory.getLog(this.getClass());
            
             /**
             * reference to the timer handle
             */
            
             private TimerHandle timerHandle = null;
            
             /**
             * Poll records after following interval.
             */
             private static int POLLING_TIME = 60000;
            
             /**
             * status flag to determine transaction state
             * set this flag to disable timer call
             */
             private static boolean processFlag = false;
            
            
             private OnCallService oncallService = null;
            
             @Resource
             private SessionContext sessionCtx;
             public void startTimer() {
            
             System.out.print ("Inside startTimer ");
             if (log.isInfoEnabled()) {
             log.info("startTimer Service ");
             }
            
             try {
             // Create timerService instance
             TimerService timerService = sessionCtx.getTimerService();
            
             Collection timers = timerService.getTimers();
             Iterator it = timers.iterator();
             while (it.hasNext()) {
             Timer aTimer = (Timer) it.next();
             if (log.isInfoEnabled()) {
             log.info("checking timer with info " + aTimer.getInfo());
             }
            
             if ((aTimer.getInfo() != null)
             && ((aTimer.getInfo().equals(this.getClass().getName())))) {
             aTimer.cancel();
             if (log.isInfoEnabled()) {
             log.info("Successfully Cancelled "
             + this.getClass().getName());
             }
            
             }
             }
            
             //at this point all timers should be canceled.
             //now we can create our own timer.
            
             Timer timer = timerService.createTimer(0, POLLING_TIME, this.getClass()
             .getName());
             timerHandle = timer.getHandle();
             } catch (Exception e) {
             log.error("An exception occurred while creating the Oncall Timer.",
             e);
             }
             return;
             }
            
            
            
             public void endTimedService() throws EJBException {
             System.out.print ("Inside endTimedService ");
             if (log.isInfoEnabled()) {
             log.info("endTimedService ");
             }
             try {
             TimerService timerService = sessionCtx.getTimerService();
             Collection timers = timerService.getTimers();
             Iterator it = timers.iterator();
             while (it.hasNext()) {
             Timer myTimer = (Timer) it.next();
             if ((myTimer.getInfo().equals(this.getClass().getName()))) {
             myTimer.cancel();
             if (log.isInfoEnabled()) {
             log.info("Successfully Cancelled "
             + this.getClass().getName());
             }
             }
             }
             } catch (Exception e) {
             log.error("Exception after cancelling timer!", e);
             }
             return;
             }
            
            
            
             @Timeout
             public void timeout(Timer timer){
            
             System.out.print ("initiateServiceBean ");
             if (log.isDebugEnabled()) {
             StringBuffer debug = new StringBuffer();
             debug
             .append("OncallTimedService: Searching for requests ready to process.");
             log.debug(debug.toString());
             }
            
             if (!processFlag){
             try {
            
             // set the process flag
             processFlag = true;
            
             // Call getCalendar method of Oncall service object
             oncallService.getCalendar();
             //reset the process flag
             processFlag = false;
             }catch (Throwable t) {
             if (log.isWarnEnabled()) {
             log
             .warn(
             "An exception occurred while searching for the pager forwards.",
             t);
             }
            
             processFlag = false;
            
             throw new EJBException(t.toString());
             }
            
            
             }
             return;
            }
            
            
            }



            Also I added following entry in the
            C:\jboss-4.2.1.GA\server\tools1\confstandardjboss.xml
            <container-configuration>
             <container-name>Singleton oncall Standard Stateless SessionBean</container-name>
             <call-logging>false</call-logging>
             <invoker-proxy-binding-name>stateless-unified-invoker</invoker-proxy-binding-name>
             <container-interceptors>
             <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
             <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
             <interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
             <!-- CMT -->
             <interceptor transaction="Container">org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
             <interceptor transaction="Container">org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
             <interceptor transaction="Container">org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor</interceptor>
             <!-- BMT -->
             <interceptor transaction="Bean">org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor</interceptor>
             <interceptor transaction="Bean">org.jboss.ejb.plugins.TxInterceptorBMT</interceptor>
             <interceptor transaction="Bean">org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
             <interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor>
             </container-interceptors>
             <instance-pool>org.jboss.ejb.plugins.StatelessSessionInstancePool</instance-pool>
             <instance-cache></instance-cache>
             <persistence-manager></persistence-manager>
             <container-pool-conf>
             <MaximumSize>1</MaximumSize>
             </container-pool-conf>
             </container-configuration>



            Other than this i did not do anything.
            Thanks
            Pramkum.

            • 3. Re: TIMER SERVICE EJB 3.0 - Need Help
              jaikiran pai Master

               

              public void startTimer() {


              Who calls the startTimer() method and when?

              * @jboss.container-configuration name="Singleton oncall Standard Stateless SessionBean"


              Using xdoclet?

              And i don't see a reason why you need to touch the standardjboss.xml (which by the way, EJB3 does not use).

              • 4. Re: TIMER SERVICE EJB 3.0 - Need Help
                Pramod Upadhyay Newbie

                Jai,

                I am new to Timer Service. I never used it.


                I was having EJB 2.1 Sample that's why i touched the standardjboss.xml.

                I thought container will call startTimer() but where to make that entry so that startTimer() will kick off , that i do not know.

                In my code i did not do anything to call startTimer() .

                Thanks

                • 5. Re: TIMER SERVICE EJB 3.0 - Need Help
                  Pramod Upadhyay Newbie

                  I am using Jboss 4.2.1


                  Does by using following before startTimer() will call the startTimer() method . My application needs to get trigger after every 5 minute.
                  l


                  /**
                   * An example business method
                   *
                   * @ejb.interface-method view-type = "both"
                   *
                   * @throws EJBException
                   * Thrown if method fails due to system-level error.
                   */


                  • 6. org.jboss.ejb.txtimer.TimerServiceImpl] Cannot create txtime
                    Pramod Upadhyay Newbie

                    Hi All,

                    I am using Servlet at startup to kick my startTimer(). But when startTimer() method is called its throwing error. I am attaching error Log...

                    2009-03-18 15:17:35,783 ERROR [org.jboss.ejb.txtimer.TimerServiceImpl] Cannot create txtimer
                    java.lang.IllegalStateException: Unable to persist timer
                     at org.jboss.ejb.txtimer.DatabasePersistencePolicy.insertTimer(DatabasePersistencePolicy.java:124)
                     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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                     at $Proxy30.insertTimer(Unknown Source)
                     at org.jboss.ejb.txtimer.TimerServiceImpl.createTimer(TimerServiceImpl.java:256)
                     at org.jboss.ejb.txtimer.TimerServiceImpl.createTimer(TimerServiceImpl.java:202)
                     at org.jboss.ejb3.timerservice.jboss.TimerServiceFacade.createTimer(TimerServiceFacade.java:66)
                     at edu.vanderbilt.its.oncall.ejb.OnCallTimerBean.startTimer(OnCallTimerBean.java:102)
                     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.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
                     at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
                     at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
                     at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
                     at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:214)
                     at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:184)
                     at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:81)
                     at $Proxy188.startTimer(Unknown Source)
                     at edu.vanderbilt.its.oncall.LoadTimer.init(LoadTimer.java:27)
                     at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
                     at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
                     at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4069)
                     at org.apache.catalina.core.StandardContext.start(StandardContext.java:4373)
                     at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)
                     at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)
                     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
                     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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
                     at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                     at org.apache.catalina.core.StandardContext.init(StandardContext.java:5310)
                     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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
                     at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                     at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
                     at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
                     at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
                     at org.jboss.web.WebModule.startModule(WebModule.java:83)
                     at org.jboss.web.WebModule.startService(WebModule.java:61)
                     at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                     at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                     at sun.reflect.GeneratedMethodAccessor88.invoke(Unknown Source)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:585)
                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                     at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                     at $Proxy0.start(Unknown Source)
                     at org.jboss.system.ServiceController.start(ServiceController.java:417)
                     at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:585)
                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                     at $Proxy45.start(Unknown Source)
                     at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
                     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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                     at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                     at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                     at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
                     at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
                     at org.jboss.ws.integration.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:93)
                     at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
                     at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                     at $Proxy46.start(Unknown Source)
                     at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
                     at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
                     at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:585)
                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                     at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                     at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                     at $Proxy9.deploy(Unknown Source)
                     at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
                     at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
                     at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
                     at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
                     at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
                    Caused by: java.sql.SQLException: ORA-12899: value too large for column "TOOLS1"."TIMERS"."TARGETID" (actual: 98, maximum: 80)
                    
                     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
                     at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
                     at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
                     at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623)
                     at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181)
                     at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:543)
                     at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1028)
                     at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2888)
                     at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:2960)
                     at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:251)
                     at org.jboss.ejb.txtimer.GeneralPurposeDatabasePersistencePlugin.insertTimer(GeneralPurposeDatabasePersistencePlugin.java:231)
                     at org.jboss.ejb.txtimer.DatabasePersistencePolicy.insertTimer(DatabasePersistencePolicy.java:120)
                     ... 138 more
                    2009-03-18 15:17:36,298 ERROR [edu.vanderbilt.its.oncall.ejb.OnCallTimerBean] An exception occurred while creating the Oncall Timer.
                    java.lang.NullPointerException
                     at edu.vanderbilt.its.oncall.ejb.OnCallTimerBean.startTimer(OnCallTimerBean.java:104)
                     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.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
                     at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
                     at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
                     at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
                     at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
                     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                     at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:214)
                     at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:184)
                     at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:81)
                     at $Proxy188.startTimer(Unknown Source)
                     at edu.vanderbilt.its.oncall.LoadTimer.init(LoadTimer.java:27)
                     at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
                     at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
                     at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4069)
                     at org.apache.catalina.core.StandardContext.start(StandardContext.java:4373)
                     at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)
                     at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)
                     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
                     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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
                     at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                     at org.apache.catalina.core.StandardContext.init(StandardContext.java:5310)
                     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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
                     at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                     at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
                     at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
                     at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
                     at org.jboss.web.WebModule.startModule(WebModule.java:83)
                     at org.jboss.web.WebModule.startService(WebModule.java:61)
                     at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                     at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                     at sun.reflect.GeneratedMethodAccessor88.invoke(Unknown Source)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:585)
                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                     at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                     at $Proxy0.start(Unknown Source)
                     at org.jboss.system.ServiceController.start(ServiceController.java:417)
                     at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:585)
                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                     at $Proxy45.start(Unknown Source)
                     at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
                     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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                     at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                     at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                     at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
                     at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
                     at org.jboss.ws.integration.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:93)
                     at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
                     at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                     at $Proxy46.start(Unknown Source)
                     at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
                     at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
                     at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:585)
                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                     at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                     at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                     at $Proxy9.deploy(Unknown Source)
                     at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
                     at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
                     at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
                     at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
                     at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
                    2009-03-18 15:17:36,704 TRACE [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] putting ManagedConnection back into pool kill=false cl=org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@154ab89[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@1c9d0e1 handles=0 lastUse=1237406126651 permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$PoolBySubject@186d315 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@6f6a6a xaResource=org.jboss.resource.connectionmanager.xa.JcaXAResourceWrapper@b0730e txSync=null]
                    2009-03-18 15:17:36,704 TRACE [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Returning connection to pool org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@154ab89[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@1c9d0e1 handles=0 lastUse=1237407456704 permit=false trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$PoolBySubject@186d315 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@6f6a6a xaResource=org.jboss.resource.connectionmanager.xa.JcaXAResourceWrapper@b0730e txSync=null] [InUse/Available/Max]: [0/20/10]
                    2009-03-18 15:17:36,704 TRACE [org.jboss.security.SecurityAssociation] popSubjectContext, sc=org.jboss.security.SecurityAssociation$SubjectContext@3c28ab{principal=null,subject=null}



                    Please suggest why its throwing error.

                    Thanks

                    • 7. Re: org.jboss.ejb.txtimer.TimerServiceImpl] Cannot create tx
                      henk de boer Master

                       

                      "pramkum" wrote:
                      Hi All,

                      I am using Servlet at startup to kick my startTimer(). But when startTimer() method is called its throwing error. I am attaching error Log...


                      In EJB3 timers are persistent. Your datasource that is supposed to store this persistent timer data probably has some limitation on some field used for this:


                      value too large for column "TOOLS1"."TIMERS"."TARGETID" (actual: 98, maximum: 80)


                      Try to remove the constraint from that column (inside the DB) and see if that helps.