-
1. Re: Error injecting TimerService
kapitanpetko Jan 15, 2010 11:39 AM (in response to kapitanpetko)I tried removing @Named and @Inject-ing into another bean, but the result is the same.
-
2. Re: Error injecting TimerService
nickarls Jan 15, 2010 11:52 AM (in response to kapitanpetko)I wouldn't be sure sure 6.0 M1 has EJB 3.1
-
3. Re: Error injecting TimerService
nickarls Jan 15, 2010 11:54 AM (in response to kapitanpetko)It appears as some 3.1 functionality would go into M2
-
4. Re: Error injecting TimerService
kapitanpetko Jan 16, 2010 4:52 AM (in response to kapitanpetko)Well, the app deploys fine, so at least some stubs are in place. The TimerService has some new methods in 3.1, but is not new. The problem is I am not even calling anything, it is injection that fails. @Resource TimerService timerService works in EJB 3.0, so it should work with Weld. I don't have JBoss here, but I am pretty sure it is not bound to java:/comp/env/weldtest.weldjsf.AsyncTest/timerService.
-
5. Re: Error injecting TimerService
nickarls Jan 17, 2010 9:32 PM (in response to kapitanpetko)Can you check with the console if it is in JNDI where you expect it?
-
6. Re: Error injecting TimerService
kapitanpetko Jan 18, 2010 3:13 AM (in response to kapitanpetko)According to the spec:
The container must make the TimerService interface available either through injection using the Resource annotation or in JNDI under the name java:comp/TimerService,
It is not in java:comp/TimerService, so it should be with @Resource. I also tried injecting
SessionContext but I get the same error:java.lang.RuntimeException: Error looking up java:/comp/env/weldtest.weldjsf.AsyncTest/sessionContext in JNDI org.jboss.weld.injection.spi.helpers.AbstractResourceServices.resolveResource(AbstractResourceServices.java:38)
Apparently Weld is treating those as if they were 'normal' beans, but they are container-provided, so I think this wrong?
One more thing, this is a WAR (created with the Weld JSF archetype), so maybe this is the problem? I haven't read
the whole spec (JSR 318, it is huge!), but if one can have EJB's in a WAR, the expected container services should be accessible.So the question still stands, is this a bug in Weld or JBoss?
Will try GF when I get some time.
-
7. Re: Error injecting TimerService
kapitanpetko Jan 18, 2010 3:58 AM (in response to kapitanpetko)Both @Resource TimerService timerService and @Resource SessionContext sessionContext work on GF (same war).
-
8. Re: Error injecting TimerService
nickarls Jan 18, 2010 8:39 AM (in response to kapitanpetko)If JBoss really ties the TimerService to java:comp/Timerservice correctly, it appears to be a bug in the integration where JBoss reports to Weld on which EJB:s are available where. Could you please file a JIRA?
-
9. Re: Error injecting TimerService
kapitanpetko Jan 18, 2010 10:15 AM (in response to kapitanpetko)I checked JBoss 4.2 and 5.1: neither have it at java:comp/Timerservice, but injection with @Resource works. Maybe I wasn't clear earlier: JBoss 6.0 M1 doesn't have it at java:comp/Timerservice either. That shouldn't a problem though: 4.2 and 5.1 work fine without the JNDI entry.
Will file a JIRA with JBoss 6.
Thanks.
-
10. Re: Error injecting TimerService
kapitanpetko Jan 18, 2010 10:23 AM (in response to kapitanpetko) -
11. Re: Error injecting TimerService
kapitanpetko Jan 19, 2010 2:31 AM (in response to kapitanpetko)
Nikolay Elenkov wrote on Jan 18, 2010 10:23:
JBAS-7627I wasn't aware that Weld integration is a separate project. The JIRA is now WELDINT-32