Details
-
Bug
-
Resolution: Obsolete
-
Major
-
None
-
2.1.0.GA
-
None
-
None
Description
Using JBoss AS 6, I have a JAX-RS resource that's also an EJB bean.
EJB injections work and the methods are correctly mapped to the declared URLs, but it seems that REST injections do not take place if RestEasy looks up the bean via JNDI.
The following bean is defined in a separate EJB module, and it's JNDI name is declared in web.xml of a web module:
@Produces("application/xml")
@Path("xxx")
@Stateless
public class TestResource {
@Context
private SecurityContext security;
@EJB
private SomeEJB someEJB;
@GET
@Path("bla")
public User getTest()
}
What happens is:
* When invoking localhost:8080/myroot/xxx/bla, getTest() is correctly called.
* someEJB has a correct stub reference
* security remains null
If I put a similar bean directly in the web module and omit the EJB annotations, the SecurityContext is correctly injected:
@Produces("application/xml")
@Path("yyy")
public class TestWebResource {
@Context
private SecurityContext security;
@GET
@Path("bla")
public User getTest() { return "<hi>hi!</hi>"; }
}