ApplicationContextException: Unable to start web server; nested exception is java.lang.NoSuchMethodError: org.apache.coyote.AbstractProtocol.setAcceptCount(I)V
Description:
An attempt was made to call the method org.apache.coyote.AbstractProtocol.setAcceptCount(I)V but it does not exist. Its class, org.apache.coyote.AbstractProtocol, is available from the following locations:
jar:file:/D:/MavenRepo/org/apache/tomcat/embed/tomcat-embed-core/8.5.11/tomcat-embed-core-8.5.11.jar!/org/apache/coyote/AbstractProtocol.class
It was loaded from the following location:
file:/D:/MavenRepo/org/apache/tomcat/embed/tomcat-embed-core/8.5.11/tomcat-embed-core-8.5.11.jar
我启动报错的原因是tomcat相关的jar包spring-boot-starter-tomcat版本冲突了。
已依赖:
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
1、这个自带spring-boot-starter-tomcat的jar包,不需要额外引入,否则版本不一致会冲突。
2、还有其它人出现的问题可能是将工程部署到tomcat了,取消部署就行了。