Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Solving "EJB Timer Service Not Available" Error in Glassfish Application Server

DZone's Guide to

Solving "EJB Timer Service Not Available" Error in Glassfish Application Server

If you've encountered an EJB timer service error in Glassfish, Sam Sepassi explains how deleting a marker file may solve the issue.

· Integration Zone ·
Free Resource

SnapLogic is the leading self-service enterprise-grade integration platform. Download the 2018 GartnerMagic Quadrant for Enterprise iPaaS or play around on the platform, risk free, for 30 days.

An EJB timer service is a container-provided service that helps system developers to schedule or to perform any operation behind the scenes. These daemon-like tasks perform jobs based on a calendar-like scheduling script. The @Schedule annotation on EJB methods and a CRON-like script is used to make this magic happen.

Applications servers keep track of these active timers by persisting the information about them. Application servers use this information to restore, to reschedule or to recover available timers when the server is taken offline.

The Glassfish application server uses its embedded JAVADB to persist the state of its available EJB timers. Not setting the data resource for the timer service correctly prevents the EJB timers from being restored and eventually from functioning properly. In this case, normally the “EJB timer service not available” error message is returned. This problem prevents any application that uses an EJB timer service from being started or deployed.

There are two procedures available to overcome such blocking situations:

The first solution is to go to JDBC connection pools and double check the health of the Timerpool connection pool by pinging it. If the ping fails then the connection pool needs to be checked or to be redefined.

If pinging the connection pool is successful, then the problem could be the presence of the EJB timer marker file. A marker file is created whenever a problem occurs during the EJB timer service start-up or restore.

Deleting the marker will solve the problem. The marker file "ejb-timer-service-app" located under as-install-parent/glassfish/domains/domain-name/generated/ejb/. Dont forget to restart Glassfish !

Download A Buyer's Guide to Application and Data Integration, your one-stop-shop for research, checklists, and explanations for an application and data integration solution.

Topics:
java ee ,java ,ejb ,glassfish ,application server ,oracle

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}