CancelEJBTimers command example

Examples are presented to illustrate how to use the command to cancel Enterprise JavaBeans (EJB) timers.

To use the CancelEJBTimers command to cancel all EJB timers on a server called server1:

cancelEJBTimers server1 -all

To cancel all EJB timers on server1, associated with the Increment bean in the DefaultApplication:

[8.5.5.16 or later]
cancelEJBTimers server1 -app DefaultApplication.ear -mod DefaultWebApplication.war -bean IncrementSSB

To cancel a specific EJB timer identified through the FindEJBTimers command or from a system log entry indicating a problem or failure:

cancelEJBTimers server1 -timer 25

Increment in the DefaultApplication does not implement the TimedObject interface, and so could not actually have associated EJB Timers. Increment is used merely for illustrative purposes in this example.

Avoid trouble:
  • The CancelEJBTimers command also cancels automatically created persistent timers. When automatically created persistent timers are canceled, the only way to recreate them is to uninstall the application and reinstall it again.
  • If an application creates many enterprise bean timers, the CancelEJBTimers command can fail with an OutOfMemoryError error condition. You can avoid this error condition by limiting the number of timers that are canceled by using the -app, -mod, and -bean command options. If the OutOfMemoryError error condition continues to occur, the command that is located in the \profiles<profile>\bin directory can be updated to increase the maximum memory by adding the -Xmx parameter. For example, add -Xmx8096m to the line that runs JAVA_EXE.