java.lang.IllegalStateException Timer already cancelled
 Technote (FAQ)
 
Problem
During the loading of Web modules, you receive the exception "java.lang.IllegalStateException Timer already canceled".
 
Cause
This error might occur due to the Load at startup option being enabled for the Web module. This applies if your application has servlets that are configured to load at startup, then try to access enterprise beans during startup.
 
Solution
In WebSphere® Application Server V4.0 releases, you cannot control the order of loading of EJB™ modules or Web modules. During the servlet initialization, if enterprise beans are being accessed, and if the enterprise bean loading is not completed by that time, you receive a "java.lang.IllegalStateException Timer already canceled" exception, and the Web module does not load.

There are two solutions to correct this problem:

  1. Introduce some delay in the servlet init() method before accessing the enterprise beans.
  2. Disable the Load at startup option.
To disable this option, use the Application Assembly Tool (AAT) before deploying enterprise archive (EAR):
  1. Open the EAR file using the AAT.
  2. Expand application, then expand Web Modules.
  3. Expand the appropriate Web module.
  4. Expand Web Components.
  5. Select the component that accesses enterprise beans at startup.
  6. On the right side, select the General tab.
  7. Clear the Load on startup check box.
  8. Repeat steps 4-through-6 for other Web components that access enterprise beans at startup.
  9. Click Apply.

Modifying the web.xml file (for deployed EAR):

  1. Stop the application server on which the Web module is installed.
  2. Navigate to the following directory:

    $WAS_HOME\installedApps\application_name\war_module\WEB-INF

  3. Open the web.xml file.
  4. Remove the following entry from the file for all appropriate servlets:

    <load-on-startup>1</load-on-startup>

    Where 1 is priority of loading; this number can be different.

  5. Save the file and restart the Application Server.
 
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > Servlet Engine/Web Container
Operating system(s): HP-UX
Software version: 4.0.7
Software edition:
Reference #: 1164682
IBM Group: Software Group
Modified date: Mar 30, 2004