Which version of JBossAS and is it EJB3 or EJB2.x? Also please post the exact contents including the dtd/xsd declaration of your jboss.xml.
While posting logs or xml content or code, please remember to wrap it in a code block by using the Code button in the message editor window. Please use the Preview button to ensure that your post is correctly formatted.
I am using EJB3 and JBoss 4.2.3. When dealing with EJB3, what is the name of the EJB? Is it the class name, the interface name, jndi name, or should I specify the name via annotations?
<?xml version="1.0"?> <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_4_2.dtd"> <jboss> <enterprise-beans> <session> <ejb-name>ProductCacheUpdaterBean</ejb-name> <timer-persistence>false</timer-persistence> </session> <session> <ejb-name>CategoryCacheUpdaterBean</ejb-name> <timer-persistence>false</timer-persistence> </session> </enterprise-beans> </jboss>
This is the code that I have in the beans that are creating the timers.
getSessionContext().getTimerService().createTimer(intervalDuration, intervalDuration, divisionKeys);
The getSessionContext() is an inherited method from the base class that declares a private field:
@Resource(name = "ses_context_ref")
private SessionContext sessionContext;
I have tried every possible <ejb-name> but nothing seems to work. I have tried the bean impl class name, the interface name, and JNDI name. What else could it be?
Non-persistent timers are not supported in the current EJB 3 implementation.
I know they are not supported in the EJB 3.0 spec, however this is a JBoss extension since it's in the jboss.xml file. This is documented in the dtd for jboss.xml that comes with the installation and I have also seen it mentioned online.
One would think that since JBoss has it in the DTD, that it should work.