1
resposta

Gerei o jar mas ao executar o java -jar, dá erro

Executei o mvn package, ele gerou o jar e o jar.original. Mas, ao executar o comando java -jar ListaVip-0.0.1-SNAPSHOT.jar, ele dá o erro abaixo. Alguem passou por isso?

Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:58) Caused by: java.lang.IllegalArgumentException: Unable to load factories from location [META-INF/spring.factories] at org.springframework.core.io.support.SpringFactoriesLoader.loadSpringFactories(SpringFactoriesLoader.java:147) at org.springframework.core.io.support.SpringFactoriesLoader.loadFactoryNames(SpringFactoriesLoader.java:119) at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:426) at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:418) at org.springframework.boot.SpringApplication.(SpringApplication.java:266) at org.springframework.boot.SpringApplication.(SpringApplication.java:247) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) at br.com.alura.listavip.Configuracao.main(Configuracao.java:17) ... 8 more Caused by: java.util.zip.ZipException: invalid stored block lengths at java.util.zip.InflaterInputStream.read(Unknown Source) at org.springframework.boot.loader.jar.ZipInflaterInputStream.read(ZipInflaterInputStream.java:52) at java.io.FilterInputStream.read(Unknown Source) at java.util.Properties$LineReader.readLine(Unknown Source) at java.util.Properties.load0(Unknown Source) at java.util.Properties.load(Unknown Source) at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:140) at org.springframework.core.io.support.PropertiesLoaderUtils.loadProperties(PropertiesLoaderUtils.java:122) at org.springframework.core.io.support.SpringFactoriesLoader.loadSpringFactories(SpringFactoriesLoader.java:136) ... 16 more

1 resposta

Já tive este erro recomendo que import novamente a "java.util" pois isso é um problema gerado na chamada da ZipException