Error Messages: org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: javax.servlet.http.HttpServletResponse.setContentLengthLong(J)V
Problem Description
type Exception report message Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: javax.servlet.http.HttpServletResponse.setContentLengthLong(J)V description The server encountered an internal error that prevented it from fulfilling this request. exception org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: javax.servlet.http.HttpServletResponse.setContentLengthLong(J)V org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1082) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) javax.servlet.http.HttpServlet.service(HttpServlet.java:621) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) javax.servlet.http.HttpServlet.service(HttpServlet.java:728) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.2.10.RELEASE</version>
</dependency>
Solution:
Import the coordinates of javax.servlet-api and spring-webmvc to the same version
Or change it to the version in the image above
Read More:
- [Solved] JSONUtil.toJsonStr() Error: org.springframework.web.util.NestedServletException: Handler dispatch failed…
- Error resolution: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/Datatype
- [Solved] eureka Startup Error: Unable to start web … nested exception is org.springframework.boot.web.server.WebS
- [Solved] eureka Startup Error: Unable to start web … nested exception is org.springframework.boot.web.server.WebS
- [Solved] Upload Files Error: Request processing failed;nested exception is org.springframework.web.multipart.MultipartExcepti
- [Solved] Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerExcepti
- [Solved] Error creating bean with name ‘org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0‘:
- [Solved] nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
- [Solved] nested exception is org.apache.ibatis.builder.BuilderException: Error invoking SqlProvider method
- [Solved] Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerException
- [Solved] MultipartException: Failed to parse multipart servlet request; nested exception is java.lang.Runtime
- [Solved] Failed to start bean ‘eurekaAutoServiceRegistration‘; nested exception is java.lang.NullPointerExce
- [Solved] nested exception is org.flowable.common.engine.api.FlowableException: Error initialising dmn data mo
- Request processing failed; nested exception is java.lang.NullPointerException or UnsatisfiedDependencyE
- [Solved] ApiPost Error: org.springframework.web.multipart.MultipartException
- [Solved] Invocation of init method failed; nested exception is java.lang.NoSuchMethodError:
- [Solved] org.springframework.context.ApplicationContextException: Failed to start bean ‘org.springframework.a
- [Solved] swagger Failed to start bean ‘documentationPluginsBootstrapper‘; nested exception is java.lang.NullP
- [Solved] Circular view path [index]: would dispatch back to the current handler URL [] again. Che
- [Solved] java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]