gpt4 book ai didi

java - 系统找不到 : mchange-commons-java-0. 2.11

转载 作者:行者123 更新时间:2023-11-30 06:04:39 25 4
gpt4 key购买 nike

我有一个使用连接池的 Spring boot 项目。它在我的电脑上工作正常,但是当我的同事从 git 中提取代码然后尝试运行时。它抛出了如下错误:

2018-02-28 14:49:24.527  WARN 11856 --- [ost-startStop-1] o.a.tomcat.util.scan.StandardJarScanner  : Failed to scan [file:/C:/Users/ABC/.m2/repository/com/mchange/c3p0/0.9.5.2/mchange-commons-java-0.2.11.jar] from classloader hierarchy

java.io.FileNotFoundException: C:\Users\ABC\.m2\repository\com\mchange\c3p0\0.9.5.2\mchange-commons-java-0.2.11.jar (The system cannot find the file specified)
at java.util.zip.ZipFile.open(Native Method) ~[na:1.8.0_60]
at java.util.zip.ZipFile.<init>(ZipFile.java:219) ~[na:1.8.0_60]
at java.util.zip.ZipFile.<init>(ZipFile.java:149) ~[na:1.8.0_60]
at java.util.jar.JarFile.<init>(JarFile.java:166) ~[na:1.8.0_60]
at java.util.jar.JarFile.<init>(JarFile.java:130) ~[na:1.8.0_60]
at org.apache.tomcat.util.scan.JarFileUrlJar.<init>(JarFileUrlJar.java:60) ~[tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.tomcat.util.scan.JarFactory.newInstance(JarFactory.java:49) ~[tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:338) ~[tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:288) ~[tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.jasper.servlet.TldScanner.scanJars(TldScanner.java:262) [tomcat-embed-jasper-8.5.23.jar:8.5.23]
at org.apache.jasper.servlet.TldScanner.scan(TldScanner.java:104) [tomcat-embed-jasper-8.5.23.jar:8.5.23]
at org.apache.jasper.servlet.JasperInitializer.onStartup(JasperInitializer.java:101) [tomcat-embed-jasper-8.5.23.jar:8.5.23]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5196) [tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419) [tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409) [tomcat-embed-core-8.5.23.jar:8.5.23]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_60]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_60]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_60]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60]

我也尝试为 mchange-commons-java-0.2.11 添加依赖,但它仍然不起作用:

<dependency>
<groupId>com.mchange</groupId>
<artifactId>mchange-commons-java</artifactId>
<version>0.2.11</version>
</dependency>

如果您遇到过或有过相关经历,请给我留言/想法。

我们将不胜感激和欢迎您的意见或建议!

最佳答案

来自 StandardJarScanner javadoc:

The default JarScanner implementation scans the WEB-INF/lib directoryfollowed by the provided classloader and then works up the classloaderhierarchy. This implementation is sufficient to meet the requirementsof the Servlet 3.0 specification as well as to provide a number ofTomcat specific extensions. The extensions are:

  • Scanning the classloader hierarchy (enabled by default) Testing all files to see if they are JARs (disabled by default)

  • Testing all directories to see if they are exploded JARs (disabled by default)

  • All of the extensions may be controlled via configuration.

要禁止在启动时扫描特定的 jar,您可以添加此 spring boot 特定属性:

server.tomcat.additional-tld-skip-patterns=*mchange-commons-java*.jar

关于java - 系统找不到 : mchange-commons-java-0. 2.11,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49022204/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com