2017-06-17 541 views
0

我正在嘗試使用嵌入式tomcat版本8.0.15.Downloaded maven dependency into my project。嵌入式tomcat無法從類加載器heirarchy中掃描jars

創建必要的上下文和實例.Tomcat服務器很好。 但我得到以下警告

Jun 17, 2017 9:50:44 PM org.apache.tomcat.util.scan.StandardJarScanner scan 
WARNING: Failed to scan [file:/C:/Users/raghavender.n/.m2/repository/xalan/xalan/2.7.2/xercesImpl.jar] from classloader hierarchy 
java.io.FileNotFoundException:C:\Users\raghavender.n\.m2\repository\xalan\xalan\2.7.2\xercesImpl.jar (The system cannot find the file specified) 
WARNING: Failed to scan [file:/C:/Users/raghavender.n/.m2/repository/xalan/xalan/2.7.2/xml-apis.jar] from classloader hierarchy 
java.io.FileNotFoundException: C:\Users\raghavender.n\.m2\repository\xalan\xalan\2.7.2\xml-apis.jar (The system cannot find the file specified) 

<!-- https://mvnrepository.com/artifact/org.apache.tomcat.embed/tomcat-embed-core --> 
    <dependency> 
     <groupId>org.apache.tomcat.embed</groupId> 
     <artifactId>tomcat-embed-core</artifactId> 
     <version>8.5.15</version> 
    </dependency> 

如何禁用/避免嵌入的Tomcat的jar的警告?

回答

0

不要以爲的xml-apis.jar是如與dependency hierachy通過Tomcat的嵌入核心需要依賴。

對於你的錯誤,使的xml-apis.jar的一定範圍不是 「提供」,刪除其下的C中的所有文件:/Users/raghavender.n/.m2/repository/xalan/xalan/並做「mvn clean install」然後檢查是否xml-apis.jar是否存在。

For Spring Web Application with 沒有Spring Boot的嵌入式Tomcat,可以參考this post