Getting Error: .... nested exception is java.lang.NoSuchMethodError: org.apache.catalina.Context.addServletMapping(Ljava/lang/Stri
I guess that you are using tomcat 9 instead of tomcat 8. In tomcat 8 the method org.apache.catalina.Context.addServletMapping
was marked as deprecated.
Will be removed in Tomcat 9. Use addServletMappingDecoded(String, String) Add a new servlet mapping, replacing any existing mapping for the specified pattern
Since spring-boot-starter-web
1.5.10.RELEASE is based on tomcat 8.5.27, it will not work if you run it with tomcat 9. The method that TomcatEmbeddedServletContainerFactory
want to invoke is gone. See the api doc of tomcat 9 Context.
That causes the java.lang.NoSuchMethodError
.
Try to find out if you are using tomcat 9. A mvn dependency:tree
might help.