org.apache.tomcat.util.scan.StandardJarScanner.setJarScanFilter错误的Web应用程序

时间:2015-10-01 19:25:18

标签: web-applications spring-boot spring-tool-suite

我已经从springtoolsguide网站复制了一个网络应用程序,即表单验证应用程序。我有完全相同的pom和源文件,但在尝试运行应用程序时,我收到以下错误:

 Exception in thread "main" org.springframework.context.ApplicationContextException: 
Unable to start embedded container; nested exception is java.lang.NoSuchMethodError: org.apache.tomcat.util.scan.StandardJarScanner.setJarScanFilter(Lorg/apache/tomcat/JarScanFilter;)V
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:474)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)
at com.effyis.vqsense.Application.main
(Application.java:15)
 Caused by: java.lang.NoSuchMethodError:    org.apache.tomcat.util.scan.StandardJarScanner.
 setJarScanFilter(Lorg/apache/tomcat/JarScanFilter;)V
 at  org.springframework.boot.context.embedded.tomcat.
 SkipPatternJarScanner$Tomcat8TldSkipSetter.setSkipPattern
(SkipPatternJarScanner.java:106)
at org.springframework.boot.context.embedded.tomcat.SkipPatternJarScanner.
   setPatternToTomcat8SkipFilter(SkipPatternJarScanner.java:61)
at org.springframework.boot.context.embedded.tomcat.
  SkipPatternJarScanner.<init>(SkipPatternJarScanner.java:56)
at org.springframework.boot.context.embedded.tomcat.SkipPatternJarScanner.
  apply(SkipPatternJarScanner.java:87)
at org.springframework.boot.context.embedded.tomcat.
TomcatEmbeddedServletContainerFactory.prepareContext
(TomcatEmbeddedServletContainerFactory.java:168)
at org.springframework.boot.context.embedded.tomcat.
TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer
(TomcatEmbeddedServletContainerFactory.java:154)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.
createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:157)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.
 onRefresh(EmbeddedWebApplicationContext.java:130)
... 7 more

这真烦人。我认为它与服务器的设置方式有关,包括tomcat,pivotal tc或VMWare vFabric,因为如果我尝试在那些服务器上运行它会产生完全不同的错误。这是一个springboot应用程序,只是想在Chrome浏览器中运行它。

尝试了其他帖子的建议,但这不起作用。 soln post

1 个答案:

答案 0 :(得分:0)

您在类路径上有一个旧的且不兼容的Tomcat版本。这是解决方案:Spring Boot exception: java.lang.NoSuchMethodError: StandardJarScanner.setJarScanFilter(Lorg/apache/tomcat/JarScanFilter;)V