I am trying Ivan's example of declarative scheduling.
I specified a timer in ejb-jar.xml like on p.228.
I got this error message from GlassFish 3.1.2:
"keepstate is true and will not create new auto timers during deployment".
What I tried:
1. I added a glassfish-ejb-jar.xml file in META-INF in TimerExample dynamic web project
2. Export TimerExample.jar
3. put it in the glassfish's bin folder, where asadmin.batch is
4. Type this command under directory where asadmin is : asadmin> deploy --name ScheduledStatelessSessionBean --keepstate=false TimerExample.jar
I don't get any output from the timer.
All I see from the Eclipse console is :
Info: No timers to be deleted for id: 93546707202080768
Info: Portable JNDI names for EJB ScheduledStatelessSessionBean : [java:global/ScheduledStatelessSessionBean/ScheduledStatelessSessionBean, java:global/ScheduledStatelessSessionBean/ScheduledStatelessSessionBean!com.ivan.scbcd6.ScheduledStatelessSessionBean]
Info: ScheduledStatelessSessionBean was successfully deployed in 359 milliseconds.
Any other idea how to fix the keepstate from true to false in glassfish ?
posted 4 years ago
Let me answer my own question:
As suggested by stackoverflow.com , I added <persistent>false</persistent> to ejb-jar.xml.
I keep the glassfish-ejb-jar.xml as described above.
From Eclipse's server panel, I removed the deployed TimerExample from the server and cleaned the resources from the server.
I restarted Glassfish from Eclipse. It works.