[jboss-jira] [JBoss JIRA] Commented: (JBAS-4598) TimerHandle failed to retrieve timer after JBoss restart

Thomas W (JIRA) jira-events at lists.jboss.org
Fri Oct 9 05:20:06 EDT 2009


    [ https://jira.jboss.org/jira/browse/JBAS-4598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12489123#action_12489123 ] 

Thomas W commented on JBAS-4598:
--------------------------------

I've noticed the same issue in jboss 5.1.0.GA using the hsqldb as the default datasource.

Look at my thread in the forum:

http://www.jboss.org/index.html?module=bb&op=viewtopic&t=162236

> TimerHandle failed to retrieve timer after JBoss restart
> --------------------------------------------------------
>
>                 Key: JBAS-4598
>                 URL: https://jira.jboss.org/jira/browse/JBAS-4598
>             Project: JBoss Application Server
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: JBossAS-4.0.5.GA
>         Environment: Windows XP / PostgreSQL
>            Reporter: Linoux Linoux
>
> Creating a timer, store the associated TimerHandle in DB.
> Restart JBoss server, try to get the Timer using the stored TimerHandle : javax.ejb.NoSuchObjectLocalException is thrown.
> ----------------------------------------------------------
> //In a Stateless Session :
> @TransactionAttribute(TransactionAttributeType.REQUIRED)
> public void createTimer() throws OgpException {
>     TimerService ts = ctx.getTimerService();
>     Timer newTimer = ts.createTimer(getTimerStartDate(), DateUtil.MILLIS_IN_DAY, testAge);
>     conf.setTestCleanTimerHandle(newTimer.getHandle());
>     
>     // Store conf in DB
> }
> private Timer getCurrentTimer(DbConfiguration conf) throws OgpException {
>     if (conf.getTestCleanTimerHandle() == null)
>       return null;
>     try {
>       return conf.getTestCleanTimerHandle().getTimer();
>     } catch (NoSuchObjectLocalException e) {
>         log.warn("Can't retrieve timer : it could be caused by the application redeployment", e);
>        return null;
>     }
> }
> ----------------------------------------------------------
> Using this code, call to getCurrentTimer after calling createTimer works fine, but after a JBoss restart, call to getCurrentTimer ends with a NoSuchObjectLocalException :
> javax.ejb.NoSuchObjectLocalException: Timer not available: [target=jboss.j2ee:service=EJB3,ear=ogp-app.ear,jar=ogp-ejb.jar,name=AdminCleanDbSessionBean]
>         at org.jboss.ejb.txtimer.TimerHandleImpl.getTimer(TimerHandleImpl.java:203)
>         at com.sts.ogp.ejb.admin.AdminCleanDbSessionBean.getCurrentTimer(AdminCleanDbSessionBean.java:157)
>         [...]
> JBoss uses the PostgreSQL database to store the timers and all other stuff. I have noted that the timers.timerid field changed after restarting JBoss, that could explain why the Timer is not found by the TimerHandle...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list