0

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://download.eclipse.org/jetty/ : jetty-distribution-9.2.10.v20150310) Any suggestions on how do resolve this with jetty?

coder
  • 1,901
  • 5
  • 29
  • 44
  • which `@Scope` class is that? (there's many different implementations out there, from various libraries, CDI itself, custom ones, etc ...) – Joakim Erdfelt Apr 20 '15 at 13:24
  • Do you have `org.springframework.web.context.ContextLoaderListener` also defined as a listener? – Joakim Erdfelt Apr 20 '15 at 13:26
  • possible duplicate of [Getting a 'No thread-bound request found' error from spring in my web app](http://stackoverflow.com/questions/2039522/getting-a-no-thread-bound-request-found-error-from-spring-in-my-web-app) – Joakim Erdfelt Apr 20 '15 at 13:27
  • @JoakimErdfelt I'm using: org.springframework.context.annotation.Scope. I do not have ContextLoaderListener defined. – coder Apr 20 '15 at 15:32
  • look at the answer (and comments) in the duplicate question. – Joakim Erdfelt Apr 20 '15 at 15:40

0 Answers0