excerpt from EJB 2.1 Spec section 22.4.2 (last para)
anonymous wrote :
| Timers are persistent objects. In the event of a container crash, any
single-event timers that have expired
| during the intervening time before container restart must cause the
ejbTimeout method to be invoked
| upon restart. Any interval timers that have expired during the intervening
time must cause the ejb-
| Timeout method to be invoked at least once upon restart
|
I created an interval timer within my stateless session bean upon the first
invocation of a particular business method. The timer got triggered properly
every 20 seconds until I stopped the container (issuing CTRL +C). When I
restarted the server again after a minute or so...the timer no longer
triggered. Not even once.
Just wondering if this is a bug.
Also the spec does not put any restrictions on whether the TimerService() or
its methods can be accessed from within the ejbCreate() method. But JBoss seems
to disallow it...When the SessionContext is already initialised and available
for use by the time ejbCreate() is invoked and TimerService could be obtained
without problem, then why the access to TimerService() methods is resulting in
exceptions and termed illegal?
-----------stack trace --------------
anonymous wrote :
|
| 18:47:59,365 INFO [STDOUT] setSessionContext(): Context has been set.
| 18:47:59,365 INFO [STDOUT] MYSLSBean got created !!
| 18:47:59,365 INFO [STDOUT] createTimer() being called ...
| 18:47:59,396 ERROR [AllowedOperationsAssociation] TimerService.getTimers
should not be access from this bean method: IN_
| EJB_CREATE, allowed is [IN_EJB_TIMEOUT, IN_BUSINESS_METHOD,
IN_SERVICE_ENDPOINT_METHOD]
| java.lang.IllegalStateException: TimerService.getTimers should not be
access from this bean method: IN_EJB_CREATE
|
at
org.jboss.ejb.AllowedOperationsAssociation.assertAllowedIn(AllowedOperationsAssociation.java:132)
at
org.jboss.ejb.StatelessSessionEnterpriseContext$TimerServiceWrapper.assertAllowedIn(StatelessSessionEnterpris
eContext.java:284)
at
org.jboss.ejb.StatelessSessionEnterpriseContext$TimerServiceWrapper.getTimers(StatelessSessionEnterpriseConte
xt.java:278)
at com.hp.cluster.MySLSBean.createTimer(MySLSBean.java:132)
at com.hp.cluster.MySLSBean.ejbCreate(MySLSBean.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.jboss.ejb.StatelessSessionEnterpriseContext.(StatelessSessionEnterpriseContext.java:63)
at
org.jboss.ejb.plugins.StatelessSessionInstancePool.create(StatelessSessionInstancePool.java:35)
at
org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:161)
at
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invokeHome(StatelessSessionInstanceInterceptor.java
:78)
.....
.....
.....
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3889632#3889632
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3889632
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user