树_tree 2021-07-08 12:14 采纳率: 100%
浏览 57
已采纳

SpringBoot的启动异常

img

我第一次配置SpringBoot的项目
看着尚硅谷的雷神教程,创建一个Maven项目然后导入Maven的依赖进行测试

应该是我的环境出现问题,但是不知道怎么去操作


Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-07-08 12:01:33.218 ERROR 1600 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

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

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.configureTldSkipPatterns(TomcatServletWebServerFactory.java:260)

The following method did not exist:

    org.apache.tomcat.JarScanner.setJarScanFilter(Lorg/apache/tomcat/JarScanFilter;)V

The method's class, org.apache.tomcat.JarScanner, is available from the following locations:

    jar:file:/D:/JDK/JDK/jre/lib/ext/tomcat-api.jar!/org/apache/tomcat/JarScanner.class
    jar:file:/D:/JDK/JDK/jre/lib/ext/tomcat-api.jar!/org/apache/tomcat/JarScanner.class
    jar:file:/G:/Maven_jar/org/apache/tomcat/embed/tomcat-embed-core/9.0.38/tomcat-embed-core-9.0.38.jar!/org/apache/tomcat/JarScanner.class

The class hierarchy was loaded from the following locations:

    org.apache.tomcat.JarScanner: file:/D:/JDK/JDK/jre/lib/ext/tomcat-api.jar


Action:

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


Process finished with exit code 1

  • 写回答

2条回答 默认 最新

  • 凡人歌者徐 2021-07-08 14:21
    关注

    看错误是包冲突了,把/D:/JDK/JDK/jre/lib/ext/tomcat-api.jar这个jar包移除,这样程序就会去找maven管理的那个内置tomcat的相关jar包了

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 已采纳回答 7月8日

悬赏问题

  • ¥15 一道python难题2
  • ¥15 一道python难题
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备