users@glassfish.java.net

Re: timerpool on cluster

From: <glassfish_at_javadesktop.org>
Date: Mon, 22 Sep 2008 01:49:22 PDT

the XA datasource work but I encounter new problem:

When I start the instance (the only one in the cluster), there's a problem in timer service initialization.
In server.log appear

INFO: Exception thrown from bean; nested exception is: java.lang.IllegalArgumentException: null source jav... (details)
WARNING Unable to initialize EJB Timer Service. The likely cause is the database has not been started or the... (details)
WARNING Unable to initialize EJB Timer Service. The likely cause is the database has not been started or the... (details)

details about last exception:

> Unable to initialize EJB Timer Service. The likely cause is the database has not been started or the timer database table has not been created.
> javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean; nested exception is: java.lang.IllegalArgumentException:
> null source java.lang.IllegalArgumentException:
> null source at java.util.EventObject.<init>(EventObject.java:38) at javax.sql.StatementEvent.<init>(StatementEvent.java:39)
> at com.mysql.jdbc.jdbc2.optional.JDBC4PreparedStatementWrapper.close(JDBC4PreparedStatementWrapper.java:70)
> at com.sun.jdo.spi.persistence.support.sqlstore.sql.generator.DBStatement.close(DBStatement.java:185)
> at com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager.close(SQLStoreManager.java:685)
> at com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager.executeQuery(SQLStoreManager.java:482)
> at com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager.retrieve(SQLStoreManager.java:376)
> at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl.retrieve(PersistenceManagerImpl.java:1118)
> at com.sun.jdo.spi.persistence.support.sqlstore.query.QueryImpl.doExecute(QueryImpl.java:689)
> at com.sun.jdo.spi.persistence.support.sqlstore.query.QueryImpl.executeWithArray(QueryImpl.java:607)
> at com.sun.ejb.containers.TimerBean_2100919770_ConcreteImpl.ejbSelectAllTimersByOwnerAndState(TimerBean_2100919770_ConcreteImpl.java:1700)
> at com.sun.ejb.containers.TimerBean.ejbHomeSelectAllActiveTimersOwnedByThisServer(TimerBean.java:709)
> 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:597)
> at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1067)
> at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:176)
> at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2895)
> at com.sun.ejb.containers.EJBLocalHomeInvocationHandler.invoke(EJBLocalHomeInvocationHandler.java:242)
> at $Proxy10.selectAllActiveTimersOwnedByThisServer(Unknown Source)
> at com.sun.ejb.containers.EJBTimerService.restoreTimers(EJBTimerService.java:491)
> at com.sun.ejb.containers.ContainerFactoryImpl.restoreEJBTimers(ContainerFactoryImpl.java:364)
> at com.sun.enterprise.server.ApplicationLifecycle.onReady(ApplicationLifecycle.java:348)
> at com.sun.enterprise.server.ApplicationServer.onReady(ApplicationServer.java:526)
> at com.sun.enterprise.server.PEMain.run(PEMain.java:413)
....

Timer database (mysql) was started and the table is created (but empty).

About restarting the timer I see in mysql query log that the follow query is launched:

select distinct t0.`TIMERID`, t0.`CREATIONTIMERAW`, t0.`LASTEXPIRATIONRAW`, t0.`CONTAINERID`, t0.`OWNERID`, t0.`STATE`, t0.`PKHASHCODE`, t0.`INTERVALDURATION`, t0.`INITIALEXPIRATIONRAW` from `EJB__TIMER__TBL` t0 where t0.`OWNERID` = 'instanceDAS' and t0.`STATE` = 0;

So, I think again about empty timer table problem.
Is there a way to reset it?

Maybe the timer restarting problem is due to empty table! (perhaps!)
If I undeploy and deploy the timer application exceptions arise:

Exception creating stateless session bean : [{0}] com.sun.enterprise.InjectionException:
        
> Exception attempting to inject Env-Prop: session.BillWsBean/timerService_at_Field-Injectable Resource.
> Class name = session.BillWsBean Field name=timerService_at_java.lang.String_at_session.BillWsBean/timerService@@
> into class session.BillWsBean at com.sun.enterprise.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:387)
> at com.sun.enterprise.util.InjectionManagerImpl.inject(InjectionManagerImpl.java:206)
> at com.sun.enterprise.util.InjectionManagerImpl.injectInstance(InjectionManagerImpl.java:127)
> at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:533)
> at com.sun.ejb.containers.StatelessSessionContainer.access$100(StatelessSessionContainer.java:111)
> at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:772)
> at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:199)
> at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:486)
> at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:1675)
> at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1229)
> at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:195)
> at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:127)
> at $Proxy65.initBilling(Unknown Source) at servlet.billPop.processRequest(billPop.java:68)
> at servlet.billPop.doGet(billPop.java:238) at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
....
> Caused by: javax.naming.NameNotFoundException:
> No object bound for java:comp/env/session.BillWsBean/timerService
> [Root exception is java.lang.IllegalStateException: EJB Timer Service not available]
> at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:224)
> at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:396)
> at javax.naming.InitialContext.lookup(InitialContext.java:392)
> at com.sun.enterprise.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:287) ... 42
> more Caused by: java.lang.IllegalStateException: EJB Timer Service not available
> at com.sun.ejb.containers.ContainerFactoryImpl.getEJBContextObject(ContainerFactoryImpl.java:854)
> at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:965)
> at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:173) ... 45 more

Exception creating stateless session bean : [{0}] com.sun.enterprise.InjectionException:

> Exception attempting to inject Env-Prop: session.BillWsBean/timerService_at_Field-Injectable Resource.
> Class name = session.BillWsBean Field name=timerService_at_java.lang.String_at_session.BillWsBean/timerService@@
> into class session.BillWsBean at com.sun.enterprise.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:387)
..
[Message sent by forum member 'peppeme' (peppeme)]

http://forums.java.net/jive/thread.jspa?messageID=300694