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:
- Introduce some delay in the servlet init() method before
accessing the enterprise beans.
- Disable the Load at startup option.
To disable this option, use the Application
Assembly Tool (AAT) before deploying enterprise archive (EAR):
- Open the EAR file using the AAT.
- Expand application, then expand Web Modules.
- Expand the appropriate Web module.
- Expand Web Components.
- Select the component that accesses enterprise beans at startup.
- On the right side, select the General tab.
- Clear the Load on startup check box.
- Repeat steps 4-through-6 for other Web components that access
enterprise beans at startup.
- Click Apply.
Modifying the web.xml file (for deployed EAR):
- Stop the application server on which the Web module is installed.
- Navigate to the following directory:
$WAS_HOME\installedApps\application_name\war_module\WEB-INF
- Open the web.xml file.
- 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.
- Save the file and restart the Application Server.
|