Springboot-Failed to read Class-Path attribute from manifest of jar file

以下是运行Springboot2 应用程序的时候报出来的错误信息:

错误信息比较多,心急的可以直接跳到最下面的解析。

The Class-Path manifest attribute in D:\maven_lib\org\glassfish\hk2\hk2\2.5.0-b42\hk2-2.5.0-b42.jar referenced one or more files that do not exist: file:/D:/maven_lib/org/glassfish/hk2/hk2/2.5.0-b42/hk2-utils.jar,file:/D:/maven_lib/org/glassfish/hk2/hk2/2.5.0-b42/javax.annotation-api.jar,file:/D:/maven_lib/org/glassfish/hk2/hk2/2.5.0-b42/javax.inject.jar,file:/D:/maven_lib/org/glassfish/hk2/hk2/2.5.0-b42/hk2-api.jar,file:/D:/maven_lib/org/glassfish/hk2/hk2/2.5.0-b42/aopalliance-repackaged.jar,file:/D:/maven_lib/org/glassfish/hk2/hk2/2.5.0-b42/config-types.jar,file:/D:/maven_lib/org/glassfish/hk2/hk2/2.5.0-b42/hk2-core.jar,file:/D:/maven_lib/org/glassfish/hk2/hk2/2.5.0-b42/hk2-config.jar,file:/D:/maven_lib/org/glassfish/hk2/hk2/2.5.0-b42/tiger-types.jar,file:/D:/maven_lib/org/glassfish/hk2/hk2/2.5.0-b42/hibernate-validator.jar,file:/D:/maven_lib/org/glassfish/hk2/hk2/2.5.0-b42/validation-api.jar,file:/D:/maven_lib/org/glassfish/hk2/hk2/2.5.0-b42/jboss-logging.jar,file:/D:/maven_lib/org/glassfish/hk2/hk2/2.5.0-b42/classmate.jar,file:/D:/maven_lib/org/glassfish/hk2/hk2/2.5.0-b42/hk2-locator.jar,file:/D:/maven_lib/org/glassfish/hk2/hk2/2.5.0-b42/javax.inject.jar,file:/D:/maven_lib/org/glassfish/hk2/hk2/2.5.0-b42/javassist.jar,file:/D:/maven_lib/org/glassfish/hk2/hk2/2.5.0-b42/hk2-runlevel.jar,file:/D:/maven_lib/org/glassfish/hk2/hk2/2.5.0-b42/class-model.jar,file:/D:/maven_lib/org/glassfish/hk2/hk2/2.5.0-b42/asm-all-repackaged.jar

Exception in thread "main" java.lang.IllegalStateException: Failed to read Class-Path attribute from manifest of jar file:/D:/maven_lib/com/github/virtuald/curvesapi/1.05/curvesapi-1.05.jar

at org.springframework.boot.devtools.restart.ChangeableUrls.getUrlsFromClassPathOfJarManifestIfPossible(ChangeableUrls.java:132)

at org.springframework.boot.devtools.restart.ChangeableUrls.fromClassLoader(ChangeableUrls.java:98)

at org.springframework.boot.devtools.restart.DefaultRestartInitializer.getUrls(DefaultRestartInitializer.java:91)

at org.springframework.boot.devtools.restart.DefaultRestartInitializer.getInitialUrls(DefaultRestartInitializer.java:55)

at org.springframework.boot.devtools.restart.Restarter.(Restarter.java:142)

at org.springframework.boot.devtools.restart.Restarter.initialize(Restarter.java:556)

at org.springframework.boot.devtools.restart.RestartApplicationListener.onApplicationStartingEvent(RestartApplicationListener.java:67)

at org.springframework.boot.devtools.restart.RestartApplicationListener.onApplicationEvent(RestartApplicationListener.java:45)

at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)

at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)

at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)

at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)

at org.springframework.boot.context.event.EventPublishingRunListener.starting(EventPublishingRunListener.java:68)

at org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:48)

at org.springframework.boot.SpringApplication.run(SpringApplication.java:319)

at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:137)

at com.aia.Application.main(Application.java:30)

Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)

at java.util.zip.ZipFile.read(Native Method)

at java.util.zip.ZipFile.access$1400(ZipFile.java:61)

at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:715)

at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:420)

at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)

at sun.misc.IOUtils.readFully(IOUtils.java:65)

at java.util.jar.JarFile.getBytes(JarFile.java:425)

at java.util.jar.JarFile.getManifestFromReference(JarFile.java:193)

at java.util.jar.JarFile.getManifest(JarFile.java:180)

at org.springframework.boot.devtools.restart.ChangeableUrls.getUrlsFromManifestClassPathAttribute(ChangeableUrls.java:153)

at org.springframework.boot.devtools.restart.ChangeableUrls.getUrlsFromClassPathOfJarManifestIfPossible(ChangeableUrls.java:129)

... 16 more

考虑过根据以下链接来处理,但最后否决了该方案,因为工作量实在不小。

https://blog.csdn.net/u012660464/article/details/53394549

跟着想到只有运行的时候才报错,那应该是 runtime jar dependency出的问题,但是那么多Jar 包,还是不现实。

最后找关键信息,发现了上面处于中间加黑斜体字的错误提示,没错了,就是它搞的事。把对应的Jar 包从仓库删除,重新maven-update project即可。

                                                                                                    ————记录于 2019-03-18

你可能感兴趣的:(Springboot-Failed to read Class-Path attribute from manifest of jar file)