users@glassfish.java.net

Cannot Deploy Ear - EJB Timer Service Not Available

From: <forums_at_java.net>
Date: Tue, 13 Dec 2011 17:48:50 -0600 (CST)

Hi,

I have an ear that I've deployed to my Glassfish (3.1.1) domain multiple
times sucessfully.  The ear contains an ejb-jar and a bunch of lib jars. 
One of the lib jars has a class in it that has a method annotated with
javax.ejb.Schedule.  No changes have been made to this lib jar, but
"suddenly" I'm having EJB timer issues deploying the ear.

Initially I got the message:

Error occurred during deployment: Exception while deploying the app
[MyApp-ear-1.0] : Failed to create automatic timers for MyAnnotatedClass --
null. Please see server.log for more details.
The server log contained this:

[#|2011-12-13T15:07:32.088-0700|WARNING|glassfish3.1.1|org.eclipse.persistence.session.file:/opt/glassfishv3/glassfish/domains/domain1/applicati
ons/ejb-timer-service-app/WEB-INF/classes/___EJB__Timer__App|_ThreadID=19;_ThreadName=Thread-2;|
Local Exception Stack: Exception [EclipseLink-4002] (Eclipse Persistence
Services - 2.3.0.v20110604-r9504):
org.eclipse.persistence.exceptions.DatabaseException Internal Exception:
java.sql.SQLSyntaxErrorException: Table/View 'EJB__TIMER__TBL' does not
exist. Error Code: 30000 Call: SELECT COUNT("TIMERID") FROM "EJB__TIMER__TBL"
WHERE ("APPLICATIONID" = ?) bind => [1 parameter bound] Query:
ReportQuery(name="countTimersByApplication" referenceClass=TimerState
sql="SELECT COUNT("TIMERID") FROM "EJB__TIMER__TBL" WHERE ("APPLICATIONID" =
?)") at
org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:333)
at
org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:644)
at
org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:535)
etc...
I found a StackOverFlow question that stated the "fix" was to copy the
$GLASSFISH_HOME/glassfish/domains/domain1/lib/databases/ejbtimer from working
instance of Glassfish.  The server is a VM that was cloned so I went to the
original to get its version of the ejbtimer files, but that directory doesn't
exist on it.  Then I stopped Glassfish, deleted the ejbtimer directory,
restarted and tried to deploy again.  The ejbtimer dir/files were recreated,
but I still can't deploy the ear.  Now I get this error:

Error occurred during deployment: Exception while shutting down application
container :
java.lang.NullPointerException. Please see server.log for more details.
I restarted Glassfish again, tried to deploy and still the same error.  The
server.log has this:

[#|2011-12-13T16:28:48.069-0700|WARNING|glassfish3.1.1|org.eclipse.persistence.session.file:/opt/glassfishv3/glassfish/domains/domain1/applications/ejb-timer-service-app/WEB-INF/classes/___EJB__Timer__App|_ThreadID=18;_ThreadName=Thread-2;|
Local Exception Stack: Exception [EclipseLink-4002] (Eclipse Persistence
Services - 2.3.0.v20110604-r9504):
org.eclipse.persistence.exceptions.DatabaseException Internal Exception:
java.sql.SQLSyntaxErrorException: Table/View 'EJB__TIMER__TBL' does not
exist. Error Code: 30000 Call: SELECT "TIMERID", "APPLICATIONID", "BLOB",
"CONTAINERID", "CREATIONTIMERAW", "INITIALEXPIRATIONRAW", "INTERVALDURATION",
"LASTEXPIRATIONRAW", "OWNERID", "PKHASHCODE", "SCHEDULE", "STATE" FROM
"EJB__TIMER__TBL" WHERE (("OWNERID" = ?) AND ("STATE" = ?)) bind => [2
parameters bound] Query: ReadAllQuery(name="findTimersByOwnerAndState"
referenceClass=TimerState sql="SELECT "TIMERID", "APPLICATIONID", "BLOB",
"CONTAINERID", "CREATIONTIMERAW", "INITIALEXPIRATIONRAW", "INTERVALDURATION",
"LASTEXPIRATIONRAW", "OWNERID", "PKHASHCODE", "SCHEDULE", "STATE" FROM
"EJB__TIMER__TBL" WHERE (("OWNERID" = ?) AND ("STATE" = ?))") at
org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:333)
at
org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:644)
at
org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:535)
etc...
Different query, but same error.  :(

We haven't made any changes to the JDBC connection pool __TimerPool.  This
is a standalone version of Glassfish (not clustered).

Obviously something has changed, but I have no idea what or how to fix it. 
Anyone have any insight?

Thanks!


--
[Message sent by forum member 'sdoca']
View Post: http://forums.java.net/node/873930