-
Bug
-
Resolution: Done
-
Critical
-
7.0.2.Final, 7.1.0.CR1b, 7.1.0.Final, 7.1.1.Final
-
None
Considered the following stateless session bean which is propagated as a REST-Webservice:
UserPrincipalRESTService.java
@Path("/test") public interface UserPrincipalRESTService { @GET @Produces(MediaType.TEXT_PLAIN) String helloUser(); }
UserPrincipalRESTServiceImpl.java
@Stateless @Local public class UserPrincipalRESTServiceImpl implements UserPrincipalRESTService { @Context private SecurityContext securityContext; public String helloUser() { final String userName = securityContext.getUserPrincipal().getName(); return "Hello " + userName+"!"; } }
After a certain (sometimes very large) amount of GET Requests on the Resource, the injected SecurityContext's user principal suddenly is null and a NPE is thrown. Once this happened, every second call to the resource will throw a NPE until the application server is restarted.
- is blocked by
-
RESTEASY-676 SecurityContext not suitable for use with pooled objects
- Closed
-
RESTEASY-678 Static JAX-RS injection into SLSBs leads to stale references
- Closed