[jboss-jira] [JBoss JIRA] Reopened: (JBAS-7980) Dependency Injection inconsistent with EJB3.1/JAX-RS

Jason Greene (JIRA) jira-events at lists.jboss.org
Thu Apr 21 14:27:18 EDT 2011


     [ https://issues.jboss.org/browse/JBAS-7980?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Greene reopened JBAS-7980:
--------------------------------



Due to feedback from the community, I have split the AS7 and AS6 projects and reopened all unscheduled AS6 issues that are a year or less old. This will make it easier community members to find and work on them.

Future releases beyond 6.1 can be done provided a community member steps up to coordinate them.

> Dependency Injection inconsistent with EJB3.1/JAX-RS
> ----------------------------------------------------
>
>                 Key: JBAS-7980
>                 URL: https://issues.jboss.org/browse/JBAS-7980
>             Project: Legacy JBoss Application Server 6 
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: EJB
>    Affects Versions: 6.0.0.M2, 6.0.0.M3
>         Environment: Redhat Linux 4.1.2-41
>            Reporter: Jon Kennedy
>            Assignee: Carlo de Wolf
>
> I'm making use of the recent EJB3.1 support in JBoss6M2 to deploy a stateless session bean within a war. This bean also implements a JAX-RS annotated interface and is called as a web service. 
> The session bean uses dependency injection to get a JPA EntityManager and the EJB SessionContext:
>     @Resource 
>     private SessionContext context;
> 	 
>     @PersistenceContext(unitName="drs2_services")
>     private EntityManager em;
> The problem is that calling my service sometimes fails with a NullPointerException where I make use of the EntityManager or the SessionContext. This behavior is inconsistent and sometimes works. 
> To add more detail: 
> If I call the service and I get a NullPointerException on the EntityManager, I can work around the issue by restarting the service until the call succeeds. After it succeeds once, I won't see the NullPointerException again (until, perhaps, I restart the JBoss again).
> The SessionContext issue is a little trickier. I am able to call my webservice from the browser successfully, but when using Java's HttpUrlConnection class, I consistently get a NullPointerException on the SessionContext. 
> I followed the RestEasy 1.2 guide for configuring and annotating my project, specifically chapter 38 "EJB Integration." I didn't bundle the ReastEasy jars in my war since they are bundled with JBoss 6. 
> Any help is appreciated, I'm happy to provide more details/code if desired. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list