第一次springboot项目运行出错总结

本文记录了在尝试运行首个SpringBoot项目时遇到的问题及解决过程。错误信息提示与org.apache.coyote.AbstractProtocol类相关,通过调整项目构建路径中Tomcat配置解决了问题,实现了项目的成功运行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

以前开发项目,第一反应就是给项目配置jdk,以及tomcat。然而刚接触springboot后,第一个springboot项目一直运行不起来。然后感谢
https://blog.youkuaiyun.com/m0_43449494/article/details/86564696      找到了解决方法,以下是错误
  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.1.3.RELEASE)

2019-02-26 14:06:26.024  INFO 2768 --- [           main] com.example.demo.DemoApplication         : Starting DemoApplication on PC-20180725RGPQ with PID 2768 (D:\Downloads\demo\target\classes started by Administrator in D:\Downloads\demo)
2019-02-26 14:06:26.027  INFO 2768 --- [           main] com.example.demo.DemoApplication         : No active profile set, falling back to default profiles: default
2019-02-26 14:06:27.004  WARN 2768 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.NoSuchMethodError: org.apache.coyote.AbstractProtocol.setAcceptCount(I)V
2019-02-26 14:06:27.013  INFO 2768 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-02-26 14:06:27.022 ERROR 2768 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

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:/E:/MyEclipse2017CI/plugins/com.genuitec.eclipse.server.embedded.tomcat.core_13.0.0.me201612211440/tomcat85/lib/tomcat-coyote.jar!/org/apache/coyote/AbstractProtocol.class
    jar:file:/D:/maven/repo/org/apache/tomcat/embed/tomcat-embed-core/9.0.16/tomcat-embed-core-9.0.16.jar!/org/apache/coyote/AbstractProtocol.class

It was loaded from the following location:

    file:/E:/MyEclipse2017CI/plugins/com.genuitec.eclipse.server.embedded.tomcat.core_13.0.0.me201612211440/tomcat85/lib/tomcat-coyote.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of org.apache.coyote.AbstractProtocol

将buildpath中的tomcat配置remove掉就好了

 

运行成功

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值