java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @Context
Posted 互联新世界
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @Context相关的知识,希望对你有一定的参考价值。
【开发环境】SpringBoot+Mybatis,开发工具IDEA
【问题场景】
在做Test单元测试的时候出现了这样的异常情况;
【异常信息】
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @Context
开发工具上也提示如图这样的红色标识;
【问题分析】
出现这个异常的原因有两种情况:1、没有启动类文件;2、启动类文件和测试类文件不在同样的包路径下;
第一种情况:没有启动类文件基本不可能,因为项目在创建的时候肯定会写这个启动类文件,检查一下在main路径下是否有启动类文件,如果没有则可能是删除文件夹的时候不注意删掉了;
所以必要提示:在写项目的时候删除任何文件或者文件夹都要备份一份要删除的东西,如果删错了可以重新找回;否则真的删错了辛苦写了一周的代码,一下子就全没了,哭死的心都有;
删除文件之前要备份!!!
第二种情况:第二种情况文件路径不一致的可能性非常大,建议先检查一下;
在main路径下的StoreApplication文件和在test路径下的StoreApplicationTests文件,这两个文件的路径名称要一致,路径一致测试类才能找到启动类进行测试,否则就会出现这样的异常情况。
正常情况下是一致的,如果自己更改过文件夹名称或者删除过某些文件夹就会出现不一致的情况,所以删除文件夹要慎重,慎重!!!
【解决问题】
如果文件路径不一致,找到对应的文件,将两个文件放在相同的路径下即可,一个在main路径下,一个在test路径下,在main和test给根目录下的文件路径要完全一致;
如果没有 StoreApplication启动类文件,那自己手动敲一份;文件内容很简单,类似如下内容
import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; /** * 【解释】 * @MapperScan("com.cy.mapper") 这个注解的意思是在项目启动的时候自动加载所有的mapper接口文件,括号里面是接口的包的路径 */ @SpringBootApplication @MapperScan("com.cy.store.mapper") public class StoreApplication public static void main(String[] args) SpringApplication.run(StoreApplication.class,args); //main //class
java.lang.IllegalStateException:无法从jar文件spring-plugin-core-1.2.0.RELEASE.jar的清单中读取Class-Path属性
我使用STS 3.9版本用于创建启动弹簧启动项目 - > Web,jpa,mysql,休息组合。这是当我尝试运行spring启动应用程序时显示错误....我试图更改spring插件JAR verion到1.1.0,但仍然没有变化,我试图制作不同的项目,也只产生相同的resuly ...请帮我解决这个问题。
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
当我尝试运行没有开发工具jar它显示错误像...
:: 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:UsersHP PCDocumentsworkspace_140817ExampleSpringBoot-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
这是因为你的maven缓存中的一个jar可能已损坏,这实际上是由IllegalStateException指出的。
尝试从maven缓存中删除损坏的jar并重新构建应用程序。
在您的情况下,只需删除此特定文件并重建您的应用程序:file:/ C:/Users/HP%20PC/.m2/repository/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-插件核心 - 1.2.0.RELEASE.jar
有关此主题的更多信息,请参阅此链接:here
看起来像spring-plugin-core-1.2.0.RELEASE.jar已损坏。请从maven缓存中删除它,然后重试。
转到显示异常的路径,然后将其从该位置删除。
在您的情况下,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从上面的位置删除这个jar并清理你的项目一次,然后尝试运行该应用程序。如果此问题得到解决,如果您遇到与其他任何罐子类似的问题,请删除这些罐子。
看起来Jar文件已损坏。您是否可以执行此操作以获得MD5总和?
md5 "/C/Users/HP PC/.m2/repository/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE.jar"
正确的MD5总和可以在spring-plugin-core-1.2.0.RELEASE.jar.md5找到,应该是4e6325e5ed2c1aa1949313c184d83640
我在Eclipse IDE上遇到错误,然后快速修复修复了我遇到的所有错误。没有删除.m2中的任何内容
以上是关于java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @Context的主要内容,如果未能解决你的问题,请参考以下文章