Potential ClassCastException in RequestContextListener when destroying the request object [SPR-11378] #16005
In jersey-spring3, The org.glassfish.jersey.server.spring.scope.RequestContextFilter class creates JaxrsRequestAttributes datastructure and sets in the Threadlocal.
If an exception occurs in the calling chain of the jersey resource and the exception is not handled by jersey, then Spring's RequestContextListner bombs while destroying the threadlocal set as part of the request.
SEVERE: Exception sending request initialized lifecycle event to listener instance of class org.springframework.web.context.request.RequestContextListener
Affects: 3.2.7, 4.0.1
Reference URL: https://gist.github.com/hvvikram/8746498
Backported to: 3.2.8
The text was updated successfully, but these errors were encountered:
Juergen Hoeller commented
Good catch! We're defensively handling our RequestAttributes type expectation in the requestDestroyed callback now, performing the unbinding in any case but only invoking ServletRequestAttributes methods if actually applicable.