-
1. Re: Inject ejb into class in war
rkilcoyne.rkilcoyne.mac.com Aug 12, 2010 3:41 PM (in response to rkilcoyne.rkilcoyne.mac.com)Moved the EJB into the war file -- made no difference.
I've tried many deployment combinations and even updated RESTeasy that comes with JBoss 6 M4 to 2.0.1.GA to no avail -- the Inject doesn't happen and I get a null reference.
WTF. Frustration now setting in.
-
2. Re: Inject ejb into class in war
rkilcoyne.rkilcoyne.mac.com Aug 12, 2010 3:49 PM (in response to rkilcoyne.rkilcoyne.mac.com)Does anyone have a working CDI/RESTeasy example?
-
3. Re: Inject ejb into class in war
jharting Aug 20, 2010 6:31 AM (in response to rkilcoyne.rkilcoyne.mac.com)Rick, are you using an empty web.xml? If so, can you provide a testcase for the issue?
Take a look at the resteasy-cdi testing application http://svn.jboss.org/repos/jbossas/trunk/resteasy-int/test/cdi-test-2 We test CDI injection with JAX-RS resources in the app.
-
4. Re: Inject ejb into class in war
jharting Aug 20, 2010 6:34 AM (in response to rkilcoyne.rkilcoyne.mac.com)Does your .war contain a beans.xml file?
-
5. Re: Inject ejb into class in war
meetoblivion Aug 22, 2010 12:19 PM (in response to rkilcoyne.rkilcoyne.mac.com)There's a few subtleties that the test case points out that aren't immediately clear to someone using rest.
1. Your rest resource needs to be scoped, most people just use @RequestScoped
2. EJB injection itself is a bit flakey right now.
3. I would probably throw out there that mileage varies based on your app server. Above comments are based on GF v3.