We were able to reproduce the problem on our development environment, and
discovered the following problem. We changed our database connections
settings from the __TimerPool to a remote MySQL database.
There the table EJB_TIMER_TBL did not exist. 1. After deploying the
SimpleTimer.war we got the following error message: Caused by: Exception
[EclipseLink-4002] (Eclipse Persistence Services - 2.3.0.v20110604-r9504):
org.eclipse.persistence.exceptions.DatabaseException
Internal Exception:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table
'EJB__TIMER__TBL' doesn't exist
Error Code: 1146
Call: SELECT COUNT(`TIMERID`) FROM `EJB__TIMER__TBL` WHERE (`APPLICATIONID` =
?) 2. Then we tried to deploy it a second time and we get the following
exception:
[#|2011-09-16T10:59:16.377+0200|SEVERE|glassfish3.1.1|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=27;_ThreadName=Thread-2;|Exception
while invoking class org.glassfish.ejb.startup.EjbApplication start method
java.lang.RuntimeException: EJB Timer Service is not available ... 3.
Then we removed the ejb-timer-service-app from the glassfish applications and
from the generated directories and restarted the app server.
4. Again we tried to redeploy the SimpleTimer.war and now deployment
succeeded. Our conclusion:
If the SimpleTimer.war is installed for the first time the
ejb-timer-service-app is installed by Glassfish.
The ejb-timer-service-app created the EJB__TIMER__TBL table, but does this
only the first time it is installed.
If first the following steps are executed:
1. undeploy the SimpleTimer.war.
2. alter the database connection settings __TimerPool to another database
(in our case it was an external MySQL database)
3. restart Glassfish
4. deploy the SimpleTimer.war.
than the ejb-timer-service-app will NOT create the EJB__TIMER__TBL again,
and it throws the MySQLSyntaxErrorException: Table 'EJB__TIMER__TBL' doesn't
exist.
I think it would be nice if the ejb-timer-service-app checks at each
restart if the table exists, and if it doesn't exist that it creates the
table automatically.
The ejb-timer-service-app is mananaged by Glassfish therefore it was hard
to understand what the exact problem was.
Onother problem is that only the first time the MySQLSyntaxErrorException
is thrown and that if you redeploy the application the less specific
RuntimeException: EJB Timer Service is not available is thrown which gives
no clue about the non existing 'EJB__TIMER__TBL' table.
This rules out that its a cluster problem only.
Manuel
--
[Message sent by forum member 'mflart']
View Post: http://forums.java.net/node/841373