[
https://jira.jboss.org/jira/browse/JBAS-7980?page=com.atlassian.jira.plug...
]
Jon Kennedy commented on JBAS-7980:
-----------------------------------
It occurred to me after submitting this bug that the problems might be related to the
RestEasy project. I updated the jars in my JBoss6M2 installation and overwrote the
2.0-BETA-1 jars with the 2.0-BETA-2 jars. I'm seeing better behavior for problems 1
and 3 (so far).
However, I'm still getting the NullPointerException on the SessionContext when the
call is made from curl on the command line, or using the Java HttpUrlConnection class. I
compared the headers from Firefox (success) and curl (failure), and it looks like I can
get curl to succeed by adding "application/xml" in the "Accept"
header.
The default curl Accept header is "*/*" so it seems like this may still be a
bug. Further, even if there was a header negotiation problem, it's odd behavior for
the web service to continue execution but fail to inject the SessionContext.
Dependency Injection inconsistent with EJB3.1/JAX-RS
----------------------------------------------------
Key: JBAS-7980
URL:
https://jira.jboss.org/jira/browse/JBAS-7980
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: EJB3
Affects Versions: JBossAS-6.0.0.M2
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.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira