users@glassfish.java.net

java.lang.IllegalStateException: Timer already cancelled. - Please help!

From: <glassfish_at_javadesktop.org>
Date: Thu, 13 Nov 2008 09:39:10 PST

GlassFish/9.2U2
Platform: FedoraCore8/Linux

Situation: I have a stateless session bean called ServiceRequestExpirationHandlerBean. In one of its business methods - manageServiceRequest(), it setsup a timer to fire, once, at a said Date/time.
    public void manageServiceRequest(Servicerequest request) {
        Logger.getLogger(getClass().getName()).info("manageServiceRequest()...");
        timerService.createTimer(request.getServicedate(), request.getServicerequestid());
    }

I have a timeout method in that bean ...
    @Timeout
    public void processServiceRequest(Timer timer) {
        Logger.getLogger(getClass().getName()).info("processServiceRequest()...");
    }

Issue: The timeout method never gets called instead I get a stack dump in the logs ...

Here is the head of the stack trace I get ...
[#|2008-11-13T09:40:08.096-0700|INFO|sun-appserver9.1|com.inwiz.ejb.session.ServiceRequestExpirationHandlerBean|_ThreadID=18;_ThreadName=httpSSLWorkerThread-8080-1;|manageServiceRequest()...|#]
   2
   3 [#|2008-11-13T09:40:08.101-0700|WARNING|sun-appserver9.1|javax.enterprise.resource.jdo.persistencemanager|_ThreadID=18;_ThreadName=httpSSLWorkerThread-8080-1;_RequestID=246845c7-fd9a-4694-84cb-d77571dc0061;|JDO76520: Errors while ob taining information about the database. Got the following exception:
   4 java.lang.IllegalStateException: Timer already cancelled.
   5 at java.util.Timer.sched(Timer.java:354)
   6 at java.util.Timer.scheduleAtFixedRate(Timer.java:296)
   7 at com.sun.enterprise.resource.AbstractResourcePool.scheduleResizerTask(AbstractResourcePool.java:251)
   8 at com.sun.enterprise.resource.AbstractResourcePool.initPool(AbstractResourcePool.java:229)
   9 at com.sun.enterprise.resource.AbstractResourcePool.internalGetResource(AbstractResourcePool.java:516)
  10 at com.sun.enterprise.resource.AbstractResourcePool.getResource(AbstractResourcePool.java:443)
  11 at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:248)
  12 at com.sun.enterprise.resource.PoolManagerImpl.getResource(PoolManagerImpl.java:176)
  13 at com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:337)
  14 at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:189)
  15 at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:165)


The entaire stack dump is large and so I am including it as an attachment.

PS: I had the same application also deployed on my development box via netbeans ... runiing on Vista and I don't run into this issue ... see the log messages that I print out ...
manageServiceRequest()...
processServiceRequest()...

In this environment, the Timer fires just as expected. So, please help.
[Message sent by forum member 'rambomogambo' (rambomogambo)]

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