2
I created a Maven project in Spring-Tools Suite when I started this error appears:
Exception in thread "main" java.lang.IllegalStateException: Failed to read Class-Path attribute from manifest of jar file:/C:/Users/Manoel/.m2/repository/xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar
at org.springframework.boot.devtools.restart.ChangeableUrls.getUrlsFromClassPathOfJarManifestIfPossible(ChangeableUrls.java:102)
at org.springframework.boot.devtools.restart.ChangeableUrls.fromUrlClassLoader(ChangeableUrls.java:88)
at org.springframework.boot.devtools.restart.DefaultRestartInitializer.getUrls(DefaultRestartInitializer.java:93)
at org.springframework.boot.devtools.restart.DefaultRestartInitializer.getInitialUrls(DefaultRestartInitializer.java:56)
at org.springframework.boot.devtools.restart.Restarter.<init>(Restarter.java:139)
at org.springframework.boot.devtools.restart.Restarter.initialize(Restarter.java:539)
at org.springframework.boot.devtools.restart.RestartApplicationListener.onApplicationStartedEvent(RestartApplicationListener.java:68)
at org.springframework.boot.devtools.restart.RestartApplicationListener.onApplicationEvent(RestartApplicationListener.java:45)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)
at org.springframework.boot.context.event.EventPublishingRunListener.started(EventPublishingRunListener.java:67)
at org.springframework.boot.SpringApplicationRunListeners.started(SpringApplicationRunListeners.java:48)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:305)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1187)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1176)
at com.algaworks.vinhos.AwVinhosApplication.main(AwVinhosApplication.java:10)
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(Unknown Source)
at java.util.zip.ZipFile$ZipFileInputStream.read(Unknown Source)
at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(Unknown Source)
at java.util.zip.InflaterInputStream.read(Unknown Source)
at sun.misc.IOUtils.readFully(Unknown Source)
at java.util.jar.JarFile.getBytes(Unknown Source)
at java.util.jar.JarFile.getManifestFromReference(Unknown Source)
at java.util.jar.JarFile.getManifest(Unknown Source)
at org.springframework.boot.devtools.restart.ChangeableUrls.getUrlsFromClassPathOfJarManifestIfPossible(ChangeableUrls.java:99)
... 16 more
Follows the class AwVinhosApplication
package com.algaworks.vinhos;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class AwVinhosApplication {
public static void main(String[] args) {
SpringApplication.run(AwVinhosApplication.class, args);
}
}
It looks like a corrupted jar. Are you using Maven? Maybe it’s a good idea to delete the account from the folder
~/.m2/repository/*
(see: that reply from Soen)– Anthony Accioly
@Anthony. I’m using the Maven, I’m not finding this folder
– Jose.Lemo
This folder ". m2" is hidden you have to enable in windows view to show. They are in C:/Users/User/. m2
– Erick Maia
Open your file manager (e.g., Windows Explorer or Nautilus) and navigate to your user’s folder (e. g.,
C:\User\JoseLemo
). The briefcase.m2
may be invisible but you can navigate to it anyway by typing the path (e. g.,C:\User\JoseLemo\.m2
). Try deleting the contents of the folderrepository
and build the project (mvn clean install
) again.– Anthony Accioly
Thank you very much. It all worked out :D
– Jose.Lemo