[jboss-jira] [JBoss JIRA] (WFLY-2494) @EJB not injected in JAX-RS Resource (unless CDI is enabled)
Aslak Knutsen (JIRA)
jira-events at lists.jboss.org
Tue Nov 12 08:39:06 EST 2013
Aslak Knutsen created WFLY-2494:
-----------------------------------
Summary: @EJB not injected in JAX-RS Resource (unless CDI is enabled)
Key: WFLY-2494
URL: https://issues.jboss.org/browse/WFLY-2494
Project: WildFly
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: CDI / Weld, REST
Affects Versions: 8.0.0.Beta1, 8.0.0.CR1
Reporter: Aslak Knutsen
Assignee: Jozef Hartinger
{code}
@Path("persons")
public class MyResource {
// Ideally this state should be stored in a database
@EJB PersonSessionBean bean; // Not injected unless beans.xml in War
..
}
@Singleton
public class PersonSessionBean {
private final List<Person> list;
public PersonSessionBean() {
list = new ArrayList<>();
}
..
}
{code}
Sample: https://github.com/arun-gupta/javaee7-samples/tree/master/jaxrs/jaxrs-client/src/main/java/org/javaee7/jaxrs/client
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list