Facing java.lang.NoSuchMethodError: HttpServletRequest.getParts()Ljava/util/Collection

前端 未结 2 1697
谎友^
谎友^ 2020-12-21 06:48

I\'ve seen many issues related to this exception here in so and most of them are being solved by adding a \"commons-file-upload\" jar from apache. I tried to us

相关标签:
2条回答
  • 2020-12-21 07:21

    javax.servlet.http.HttpServletRequest.getParts() is only available starting with Servlet API 3.0

    Things to check:

    • Be sure you are running Jetty 9 (or newer)
    • Make sure you have your WEB-INF/web.xml configured to use Servlet API 3.0 (or newer)
    • Make sure your build tool is using the servlet-api 3.1 (or newer) jars.
    • (Optionally) Make sure you have the same servlet api 3.1 jar in your WEB-INF/lib directory.
    0 讨论(0)
  • 2020-12-21 07:31

    I encountered the same issue. It happened when I switched to Tomcat 6. When I switched back to Tomcat 7, the issue disappeared.

    0 讨论(0)
提交回复
热议问题