java.lang.NoSuchMethodError: javax.servlet.ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)Ljavax/servlet/ServletRegistration$Dynamic;
出现这个错误,通常是由于servlet-api版本冲突引起
java.lang.NoSuchMethodError: javax.servlet.ServletContext.addServlet(Ljava/lang/String;Ljavax/servlet/Servlet;)Ljavax/servlet/ServletRegistration$Dynamic; at org.springframework.boot.web.servlet.ServletRegistrationBean.onStartup(ServletRegistrationBean.java:191) ~[spring-boot-1.5.13.RELEASE.jar:1.5.13.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.selfInitialize(EmbeddedWebApplicationContext.java:229) [spring-boot-1.5.13.RELEASE.jar:1.5.13.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.access$000(EmbeddedWebApplicationContext.java:89) [spring-boot-1.5.13.RELEASE.jar:1.5.13.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext$1.onStartup(EmbeddedWebApplicationContext.java:213) ~[spring-boot-1.5.13.RELEASE.jar:1.5.13.RELEASE] at org.springframework.boot.context.embedded.jetty.ServletContextInitializerConfiguration$Initializer.callInitializers(ServletContextInitializerConfiguration.java:83) ~[spring-boot-1.5.13.RELEASE.jar:1.5.13.RELEASE] at org.springframework.boot.context.embedded.jetty.ServletContextInitializerConfiguration$Initializer.doStart(ServletContextInitializerConfiguration.java:72) ~[spring-boot-1.5.13.RELEASE.jar:1.5.13.RELEASE] at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.4.10.v20180503.jar:9.4.10.v20180503] at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138) [jetty-util-9.4.10.v20180503.jar:9.4.10.v20180503] at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108) [jetty-util-9.4.10.v20180503.jar:9.4.10.v20180503] at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113) [jetty-server-9.4.10.v20180503.jar:9.4.10.v20180503] at org.eclipse.jetty.server.handler.ScopedHandler.doStart(ScopedHandler.java:123) ~[jetty-server-9.4.10.v20180503.jar:9.4.10.v20180503] at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:844) ~[jetty-server-9.4.10.v20180503.jar:9.4.10.v20180503] at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:370) ~[jetty-servlet-9.4.10.v20180503.jar:9.4.10.v20180503] at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497) ~[jetty-webapp-9.4.10.v20180503.jar:9.4.10.v20180503] at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459) ~[jetty-webapp-9.4.10.v20180503.jar:9.4.10.v20180503] at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:785) ~[jetty-server-9.4.10.v20180503.jar:9.4.10.v20180503] at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:287) ~[jetty-servlet-9.4.10.v20180503.jar:9.4.10.v20180503] at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545) ~[jetty-webapp-9.4.10.v20180503.jar:9.4.10.v20180503] at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.4.10.v20180503.jar:9.4.10.v20180503] at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138) [jetty-util-9.4.10.v20180503.jar:9.4.10.v20180503] at org.eclipse.jetty.server.Server.start(Server.java:419) [jetty-server-9.4.10.v20180503.jar:9.4.10.v20180503] at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108) [jetty-util-9.4.10.v20180503.jar:9.4.10.v20180503] at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113) [jetty-server-9.4.10.v20180503.jar:9.4.10.v20180503] at org.eclipse.jetty.server.Server.doStart(Server.java:386) [jetty-server-9.4.10.v20180503.jar:9.4.10.v20180503] at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.4.10.v20180503.jar:9.4.10.v20180503] at org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainer.initialize(JettyEmbeddedServletContainer.java:104) [spring-boot-1.5.13.RELEASE.jar:1.5.13.RELEASE]
仔细检查依赖关系发现,原来是kettle-dbdialog下的servlet版本冲突,移出调即可
爆款云服务器s6 2核4G 低至0.46/天,具体规则查看活动详情