Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"javax.servlet.ServletException: non-HTTP request or response" in JBoss

My jboss is throwing undescriptive error while trying to run my application (spring mvc). It deploys ok, and this exception doesn't tell me anything useful so I don't really know what to do. I can't debug , can't do anything really :

    13:00:01,262 INFO  [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221053)] Started in 2m:13s:790ms

**Started successfully**

While running the application from the browser this happens :

13:00:09,456 ERROR [[appServlet]] Servlet.service() for servlet appServlet threw exception
javax.servlet.ServletException: non-HTTP request or response
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:818)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:619)
like image 667
London Avatar asked Feb 25 '11 12:02

London


3 Answers

This gets thrown in HttpServlet.service(ServletRequest, ServletResponse) when the parameters can't be cast to HttpServletRequest and HttpServletResponse respectively.

That means one of two things:

  • the parameters are of the wrong type (unlikely) or
  • some filter is using the wrong copy of those types, loaded with a wrong classloader (for example if you deliver your own copy of servlet-api-x.x.jar with your webapp).
like image 163
Joachim Sauer Avatar answered Nov 21 '22 00:11

Joachim Sauer


Try removing servlet-api jar from your WAR file.

like image 45
ant Avatar answered Nov 20 '22 22:11

ant


If you are using Maven, you can just set the scope of the servlet-api to provided.

like image 1
Ricardo Sousa Avatar answered Nov 20 '22 23:11

Ricardo Sousa