【spring-boot】Spring Boot常见问题(二)Unable to start embedded container; nested exception is java.lang.NoS

在运行main()方法时,抛出如下异常

经检查,在org.apache.tomcat.util.scan.StandardJarScanner类中存在setJarScanFilter(Lorg/apache/tomcat/JarScanFilter;)方法,并且亲自测试,可以正常使用。而抛出异常却说没有此方法

分析原因1.存在重复的jar包版本调整带来的影响

  经排查,发现MyEclipse Tomcat v7.0 Runtime Libraries包,和Maven Dependencies包中均包含org.apache.tomcat.util.scan.StandardJarScanner类

  

  于是,取消MyEclipse Tomcat v7.0 Runtime Libraries包,运行正常

解决办法:查看报错文件所在的包,移除重复部分

原文地址:https://www.cnblogs.com/qxlxi/p/12860952.html