-
1. Re: Injecting TimerService null when base class is in different module
nickarls Mar 20, 2013 2:48 AM (in response to sven.plath)1 of 1 people found this helpfulModule 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(?)
-
2. Re: Injecting TimerService null when base class is in different module
sven.plath Mar 20, 2013 4:06 AM (in response to nickarls)Hey,
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.
Thanks,
Sven
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).
-
3. Re: Injecting TimerService null when base class is in different module
sven.plath Mar 20, 2013 5:58 AM (in response to sven.plath)Hey,
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,
Sven
-
4. Re: Injecting TimerService null when base class is in different module
sfcoy Mar 21, 2013 5:20 AM (in response to sven.plath)Sven,
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.
-
5. Re: Injecting TimerService null when base class is in different module
sven.plath Mar 21, 2013 7:14 AM (in response to sfcoy)Hi,
I am using JBoss AS 7.2.0.Final
Regards,
Sven
-
6. Re: Injecting TimerService null when base class is in different module
sfcoy Mar 21, 2013 7:34 AM (in response to sven.plath)In that case I would expect the scenario described in your original post to work.
Seems like a bug to me.