Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.IllegalStateException: Failed to read Class-Path attribute from manifest of jar file spring-plugin-core-1.2.0.RELEASE.jar

Tags:

spring-boot

I am using STS 3.9 version with using to create starter spring boot project ->Web,jpa,mysql,rest combination.This is When i try to run the spring boot application is shows error ....I tried to change the spring plugin JAR verion to 1.1.0 but still not got changes,i tried to make different projects that also produces the same resuly only...please help me to solve this.

Exception in thread "main" java.lang.IllegalStateException: Failed to read Class-Path attribute from manifest of jar file:/C:/Users/HP%20PC/.m2/repository/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE.jar
    at org.springframework.boot.devtools.restart.ChangeableUrls.getUrlsFromClassPathOfJarManifestIfPossible(ChangeableUrls.java:110)
    at org.springframework.boot.devtools.restart.ChangeableUrls.fromUrlClassLoader(ChangeableUrls.java:96)
    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:140)
    at org.springframework.boot.devtools.restart.Restarter.initialize(Restarter.java:536)
    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.invokeListener(SimpleApplicationEventMulticaster.java:167)
    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:67)
    at org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:48)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1245)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1233)
    at com.example.demo2.ExampleSpringBoot2Application.main(ExampleSpringBoot2Application.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.getUrlsFromManifestClassPathAttribute(ChangeableUrls.java:131)
    at org.springframework.boot.devtools.restart.ChangeableUrls.getUrlsFromClassPathOfJarManifestIfPossible(ChangeableUrls.java:107)
    ... 16 more

when i try to run as without dev-tool jar it show error like ...

:: Spring Boot ::             (v2.0.0.M3)

2017-08-17 16:02:09.129  INFO 12256 --- [           main] c.e.demo2.ExampleSpringBoot2Application  : Starting ExampleSpringBoot2Application on LAPTOP-vignesh with PID 12256 (started by HP PC in C:\Users\HP PC\Documents\workspace_140817\ExampleSpringBoot-2)
2017-08-17 16:02:09.132  INFO 12256 --- [           main] c.e.demo2.ExampleSpringBoot2Application  : No active profile set, falling back to default profiles: default
2017-08-17 16:02:09.192  INFO 12256 --- [           main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@445629: startup date [Thu Aug 17 16:02:09 IST 2017]; root of context hierarchy
2017-08-17 16:02:10.095  INFO 12256 --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Overriding bean definition for bean 'httpRequestHandlerAdapter' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration; factoryMethodName=httpRequestHandlerAdapter; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration; factoryMethodName=httpRequestHandlerAdapter; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.class]]
2017-08-17 16:02:10.128 ERROR 12256 --- [           main] o.s.boot.SpringApplication               : Application startup failed

java.lang.NoClassDefFoundError: org/springframework/plugin/core/support/PluginRegistryFactoryBean
    at org.springframework.hateoas.config.LinkBuilderBeanDefinitionRegistrar.registerBeanDefinitions(LinkBuilderBeanDefinitionRegistrar.java:57) ~[spring-hateoas-0.23.0.RELEASE.jar:na]
    at org.springframework.hateoas.config.HypermediaSupportBeanDefinitionRegistrar.registerBeanDefinitions(HypermediaSupportBeanDefinitionRegistrar.java:100) ~[spring-hateoas-0.23.0.RELEASE.jar:na]
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.lambda$loadBeanDefinitionsFromRegistrars$0(ConfigurationClassBeanDefinitionReader.java:360) ~[spring-context-5.0.0.RC3.jar:5.0.0.RC3]
    at java.util.LinkedHashMap.forEach(Unknown Source) ~[na:1.8.0_144]
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:359) ~[spring-context-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:144) ~[spring-context-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:117) ~[spring-context-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:328) ~[spring-context-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:233) ~[spring-context-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:271) ~[spring-context-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94) ~[spring-context-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:693) ~[spring-context-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531) ~[spring-context-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:122) ~[spring-boot-2.0.0.M3.jar:2.0.0.M3]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:386) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1245) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1233) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
    at com.example.demo2.ExampleSpringBoot2Application.main(ExampleSpringBoot2Application.java:10) [classes/:na]
Caused by: java.lang.ClassNotFoundException: org.springframework.plugin.core.support.PluginRegistryFactoryBean
    at java.net.URLClassLoader.findClass(Unknown Source) ~[na:1.8.0_144]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_144]
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) ~[na:1.8.0_144]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_144]
    ... 20 common frames omitted

2017-08-17 16:02:10.129  INFO 12256 --- [           main] ConfigServletWebServerApplicationContext : Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@445629: startup date [Thu Aug 17 16:02:09 IST 2017]; root of context hierarchy
2017-08-17 16:02:10.130  WARN 12256 --- [           main] ConfigServletWebServerApplicationContext : Exception thrown from LifecycleProcessor on context close

java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@445629: startup date [Thu Aug 17 16:02:09 IST 2017]; root of context hierarchy
    at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:433) [spring-context-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1004) [spring-context-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:963) [spring-context-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:808) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1245) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1233) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
    at com.example.demo2.ExampleSpringBoot2Application.main(ExampleSpringBoot2Application.java:10) [classes/:na]

2017-08-17 16:02:10.131 ERROR 12256 --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Destroy method on bean with name 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory' threw an exception

java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@445629: startup date [Thu Aug 17 16:02:09 IST 2017]; root of context hierarchy
    at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:420) [spring-context-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.context.support.ApplicationListenerDetector.postProcessBeforeDestruction(ApplicationListenerDetector.java:95) ~[spring-context-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:240) ~[spring-beans-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:582) [spring-beans-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:558) [spring-beans-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:952) [spring-beans-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:527) [spring-beans-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.destroySingletons(FactoryBeanRegistrySupport.java:228) [spring-beans-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:959) [spring-beans-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1035) [spring-context-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1011) [spring-context-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:963) [spring-context-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:808) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1245) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1233) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
    at com.example.demo2.ExampleSpringBoot2Application.main(ExampleSpringBoot2Application.java:10) [classes/:na]

2017-08-17 16:02:10.131  WARN 12256 --- [           main] o.s.boot.SpringApplication               : Unable to close ApplicationContext

java.lang.IllegalStateException: Failed to introspect Class [org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration] from ClassLoader [sun.misc.Launcher$AppClassLoader@1d16e93]
    at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:659) ~[spring-core-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:556) ~[spring-core-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:541) ~[spring-core-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:599) ~[spring-core-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:728) ~[spring-beans-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:670) ~[spring-beans-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:638) ~[spring-beans-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1507) ~[spring-beans-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:421) ~[spring-beans-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:391) ~[spring-beans-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:511) ~[spring-beans-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:504) ~[spring-beans-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1191) ~[spring-context-5.0.0.RC3.jar:5.0.0.RC3]
    at org.springframework.boot.SpringApplication.getExitCodeFromMappedException(SpringApplication.java:879) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
    at org.springframework.boot.SpringApplication.getExitCodeFromException(SpringApplication.java:865) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
    at org.springframework.boot.SpringApplication.handleExitCode(SpringApplication.java:851) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
    at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:802) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1245) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1233) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
    at com.example.demo2.ExampleSpringBoot2Application.main(ExampleSpringBoot2Application.java:10) [classes/:na]
Caused by: java.lang.NoClassDefFoundError: org/springframework/plugin/core/PluginRegistry
    at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.8.0_144]
    at java.lang.Class.privateGetDeclaredMethods(Unknown Source) ~[na:1.8.0_144]
    at java.lang.Class.getDeclaredMethods(Unknown Source) ~[na:1.8.0_144]
    at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:641) ~[spring-core-5.0.0.RC3.jar:5.0.0.RC3]
    ... 20 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.plugin.core.PluginRegistry
    at java.net.URLClassLoader.findClass(Unknown Source) ~[na:1.8.0_144]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_144]
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) ~[na:1.8.0_144]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_144]
    ... 24 common frames omitted
like image 325
Vignesh R Avatar asked Aug 17 '17 10:08

Vignesh R


2 Answers

This is because you might be having one of the jars in your maven cache corrupted, which is actually pointed out by IllegalStateException.

Try removing the corrupted jar from your maven cache and re-build your application.

In your case just delete this particular file and rebuild your application.

file:/C:/Users/HP%20PC/.m2/repository/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/**spring-plugin-core-1.2.0.RELEASE.jar

For more on this topic please refer to this link : here.

like image 69
chetan choulwar Avatar answered Nov 01 '22 21:11

chetan choulwar


Seems like spring-plugin-core-1.2.0.RELEASE.jar got corrupted. Please delete it from your maven cache and try again.

Go to path where ever it is showing the exception and remove it from that location.

In your case, C:/Users/HP%20PC/.m2/repository/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE.jar

spring-plugin-core-1.2.0.RELEASE.jar delete this jar from above location and clean your project once and then try to run the application. If this issue got resolved and if you face similar issue with any other jars, please delete those jars as well.

like image 2
Trisaiteja Narina Avatar answered Nov 01 '22 21:11

Trisaiteja Narina