dimanche 19 avril 2015

Using RequestContextListener in jetty 9

I'm using jetty container for application which needs certain attributes to be bound to request. I'm using RequestContextListener in web.xml:



<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>


User class:



@Scope("request")
class User {
// some code
}


When deploying war on jetty, it fails with exception : java.lang.IllegalStateException: No thread-bound request found. And on issuing any calls to the server, it results in error 503. On the other hand, it works fine on tomcat. Tomcat gives errors on deployment but subsequent calls go through fine. Looks like it is an issue with jetty. I'm using stable-9 version of jetty (http://ift.tt/TxdOg6 : jetty-distribution-9.2.10.v20150310) Any suggestions on how do resolve this with jetty?


Aucun commentaire:

Enregistrer un commentaire