1 of 1 people found this helpful
Module as a JBoss module or module as "deployment archive"? One would think that you could help injection with a jndi-url if it's not automatic due to EE rules(?)
module as in "deployment archive".
I tried it with a lookup to java:comp/TimerService and it works. Thanks for your help. Not the most elegant solution though, since I would prefer to use @Resource. However it is working. Migration to the JBoss 7 can continue.
EDIT: When using @Resource(lookup = "java:comp/TimerService) instead of @Resource with no attributed, it works too!
EDIT 2: Forget what I said... I should know when I test with the JBoss 6 and the JBoss 7... it does not work as described above (in the JBoss 6 it obviously works, but that was expected).
I have some more information for you. Maybe you can make some sense out of it:
- When defining the timeout method annotated with @Timeout in the abstract class, it is not found an Exception is thrown (JBAS014481: Cannot invoke timeout method because method null is not a timeout method)
- When removing the abstract modifier, it still does not work. Neither @Resource nor @Timeout.
- When adding a EJB annotation to the previously abstract base class (for Example @Stateless) it is still not working. Neither @Resource nor @Timeout
However, when implementing the EJB 2.1 spec TimedObject interface, the ejbTimeout(Timer) method is called when defined in the abstract base class!
Hope this helps,
You don't mention which version of JBoss AS 7 that you're using. I believe that a lot of EJB timer related issues were cleaned up post 7.1.1.
I am using JBoss AS 7.2.0.Final
In that case I would expect the scenario described in your original post to work.
Seems like a bug to me.