Results 1 to 3 of 3

Thread: javax.servlet.ServletException: OncePerRequestFilter just supports HTTP requests

  1. #1
    Join Date
    Sep 2010
    Posts
    19

    Default javax.servlet.ServletException: OncePerRequestFilter just supports HTTP requests

    Hello friends,

    I am new to spring.

    I am trying an example mvc-basic given in https://src.springframework.org/svn/...les/mvc-basic/

    I am using eclipse 3.4.2 as my editor
    JBOSS 5.1 as server

    Following is my WEB-INF/lib directory

    appserv-jstl.jar
    hibernate-validator-4.0.2.GA.jar
    javaee.jar
    org.springframework.aop-3.0.4.RELEASE.jar
    org.springframework.asm-3.0.4.RELEASE.jar
    org.springframework.aspects-3.0.4.RELEASE.jar
    org.springframework.beans-3.0.4.RELEASE.jar
    org.springframework.context.support-3.0.4.RELEASE.jar
    org.springframework.context-3.0.4.RELEASE.jar
    org.springframework.core-3.0.4.RELEASE.jar
    org.springframework.expression-3.0.4.RELEASE.jar
    org.springframework.instrument.tomcat-3.0.4.RELEASE.jar
    org.springframework.instrument-3.0.4.RELEASE.jar
    org.springframework.jdbc-3.0.4.RELEASE.jar
    org.springframework.jms-3.0.4.RELEASE.jar
    org.springframework.orm-3.0.4.RELEASE.jar
    org.springframework.oxm-3.0.4.RELEASE.jar
    org.springframework.test-3.0.4.RELEASE.jar
    org.springframework.transaction-3.0.4.RELEASE.jar
    org.springframework.web.portlet-3.0.4.RELEASE.jar
    org.springframework.web.servlet-3.0.4.RELEASE.jar
    org.springframework.web.struts-3.0.4.RELEASE.jar
    org.springframework.web-3.0.4.RELEASE.jar
    urlrewritefilter-3.1.0.jar
    validation-api-1.0.0.GA.jar

    Now it compiles well with JBOSS server but when I am trying to run, it gives me following error.
    Code:
    [[default]] Servlet.service() for servlet default threw exception
    javax.servlet.ServletException: OncePerRequestFilter just supports HTTP requests
    	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:62)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    	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)

    Can any one help me in solving the problem.

    Let me know if you need anything else from me.

    Thanks.

  2. #2
    Join Date
    Jul 2010
    Location
    Venice, Italy
    Posts
    709

    Default

    Remove javaee.jar and appserv-jstl.jar from your WEB-INF/lib directory. The servlet API and jstl API jars should be used only as COMPILE time dependencies, but should never be packaged in your WAR since your container (JBoss) already has them on his classpath at runtime and if you package the jars with your application you will get double instances of your classes, which in turn will cause classloader issues like the one you are facing.

  3. #3
    Join Date
    Sep 2010
    Posts
    19

    Default

    Hello Enrico Pizzi,

    Thanks for the reply.

    I removed javaee.jar and it start executing !!!

    I have not removed appserv-jstl.jar as it is not present in jboss server libraries.

    removing it gives errors in my .jsp files.

    Thanks.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •