-
1. Re: @Schedule on Stateless EJB 3.1 on JBoss 6.0 Final
jlaskowski Aug 20, 2011 3:16 PM (in response to notify)Hi,
Use @Schedule(second = "*", minute = "*/1", hour = "*", info="Every 1 minute") to achieve it. According to 18.2.1.2 Expression Rules of the EJB 3.1 spec - hour defaults to 0 and that's what postpones the timer around the midnight.
Jacek
-
2. Re: @Schedule on Stateless EJB 3.1 on JBoss 6.0 Final
notify Aug 21, 2011 10:42 AM (in response to jlaskowski)Thanks.
I did try that in all my permutations.
Have added it back and it still sits there, not executing the method.
/**
* publishToDevice
*/
@Schedule(second = "*", minute = "*/1", hour = "*", persistent=false)
public void publishToDevice(Timer timer) {
log.info(">>>>> publishToDevice= " + Calendar.getInstance().getTime());
}
-
3. Re: @Schedule on Stateless EJB 3.1 on JBoss 6.0 Final
notify Aug 23, 2011 6:22 AM (in response to notify)Changed the Stateless Session bean to Singleton added annotations to my SB;
@Singleton
@StartUp
and modified the ejb-jar.xml
to be;
<session-type>Singleton<session-type>
and
<init-on-start-up>true<init-on-start-up>
the @Schedule
starts on JBoss start-up.
and prints my message to the JBoss log.