当前位置: 首页 > 知识库问答 >
问题:

java.lang.非法状态异常:无法加载配置类:com.rab3tech. SpringBootRunner

唐焕
2023-03-14
10:12:45.538 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Included patterns for restart : []
10:12:45.543 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Excluded patterns for restart : [/spring-boot-starter-[\w-]+/, /spring-boot/target/classes/, /spring-boot-starter/target/classes/, /spring-boot-devtools/target/classes/, /spring-boot-actuator/target/classes/, /spring-boot-autoconfigure/target/classes/]
10:12:45.544 [main] DEBUG org.springframework.boot.devtools.restart.ChangeableUrls - Matching URLs for reloading : [file:/C:/Users/durga/git/cubic-bank/banking-web/target/classes/, file:/C:/Users/durga/git/cubic-bank/banking-service/target/classes/, file:/C:/Users/durga/git/cubic-bank/banking-dao/target/classes/, file:/C:/Users/durga/git/cubic-bank/banking-api/target/classes/]

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.0.5.RELEASE)

2022-03-29 10:12:46.398  INFO 12292 --- [  restartedMain] com.rab3tech.SpringBootRunner            : Starting SpringBootRunner on durga-pc with PID 12292 (C:\Users\durga\git\cubic-bank\banking-web\target\classes started by durga in C:\Users\durga\git\cubic-bank\banking-web)
2022-03-29 10:12:46.401  INFO 12292 --- [  restartedMain] com.rab3tech.SpringBootRunner            : No active profile set, falling back to default profiles: default
2022-03-29 10:12:46.881  INFO 12292 --- [  restartedMain] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@3f94a37d: startup date [Tue Mar 29 10:12:46 EDT 2022]; root of context hierarchy
2022-03-29 10:12:50.112 ERROR 12292 --- [  restartedMain] o.s.boot.SpringApplication               : Application run failed

java.lang.IllegalStateException: Cannot load configuration class: com.rab3tech.SpringBootRunner
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:414) ~[spring-context-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:254) ~[spring-context-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:282) ~[spring-context-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:126) ~[spring-context-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:694) ~[spring-context-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) ~[spring-context-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:780) ~[spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) ~[spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:333) ~[spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1277) ~[spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1265) ~[spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
    at com.rab3tech.SpringBootRunner.main(SpringBootRunner.java:27) ~[classes/:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) ~[spring-boot-devtools-2.0.5.RELEASE.jar:2.0.5.RELEASE]
Caused by: java.lang.ExceptionInInitializerError: null
    at org.springframework.context.annotation.ConfigurationClassEnhancer.newEnhancer(ConfigurationClassEnhancer.java:122) ~[spring-context-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassEnhancer.enhance(ConfigurationClassEnhancer.java:110) ~[spring-context-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:403) ~[spring-context-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    ... 17 common frames omitted
Caused by: org.springframework.cglib.core.CodeGenerationException: java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @15eb5ee5
    at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:464) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:336) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:93) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:91) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
    at org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:116) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:291) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.cglib.core.KeyFactory$Generator.create(KeyFactory.java:221) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.cglib.core.KeyFactory.create(KeyFactory.java:174) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.cglib.core.KeyFactory.create(KeyFactory.java:153) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.cglib.proxy.Enhancer.<clinit>(Enhancer.java:73) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    ... 20 common frames omitted
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @15eb5ee5
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354) ~[na:na]
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) ~[na:na]
    at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199) ~[na:na]
    at java.base/java.lang.reflect.Method.setAccessible(Method.java:193) ~[na:na]
    at org.springframework.cglib.core.ReflectUtils$1.run(ReflectUtils.java:61) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:569) ~[na:na]
    at org.springframework.cglib.core.ReflectUtils.<clinit>(ReflectUtils.java:52) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:243) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:329) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    ... 32 common frames omitted

2022-03-29 10:12:50.114  INFO 12292 --- [  restartedMain] ConfigServletWebServerApplicationContext : Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@3f94a37d: startup date [Tue Mar 29 10:12:46 EDT 2022]; root of context hierarchy

共有1个答案

裴韬
2023-03-14

您正在使用的Spring Boot版本(2.0.5.RELEASE)不支持您正在使用的Java版本。您应该升级到更新版本的Spring Boot,或者降级到Java 8。我推荐前者,升级到Spring Boot 2.5。x或2.6。x、 就像Spring Boot 2.0一样。x不再受支持。

 类似资料:
  • 我正在尝试在我的maven项目上运行单元测试(使用Wiremck),并观察到以下错误。 我尝试将添加到中,如下所示 并已将其放在我的项目的文件中,并验证它是否是通过执行设置的,但我仍然收到相同的错误。 它在带有Java 8 u191的Windows机器上工作,并且没有添加任何,但在带有Java 8 u181的Linux上却不起作用。 我还尝试向我的< code>pom.xml添加以下依赖项 但仍然

  • 问题内容: 对于这个先前的问题,我将Selenium更新为2.0.1版,但是现在我又遇到了另一个错误,即使配置文件位于以下位置: 怎么了?我该如何解决这个问题? 问题答案: 更新: 硒团队已修复最新版本。对于几乎所有环境,修复程序都是: 点安装-U硒 尚不清楚它是在哪个版本上修复的(显然是r13122),但肯定是在2.26.0(更新时为最新)上已修复。 此错误意味着_wait_until_conn

  • 我在MediaCodec上得到了非法状态例外。configure()行,我正在尝试使用MediaCodec录制音频。这只发生在一些手机上,在标签上一切正常。这个特别的碰撞示例来自三星Galaxy S4。异常跟踪: 音频格式声明: 音频编码器初始化: 有人知道那可能是什么吗?奇怪的是,它只发生在某些设备上。欢迎提出任何建议!

  • 我正在从2.1.4更新我现有的springstart项目- 扩展的类的退出代码如下 这是一个在更新之前正在运行的现有代码。更新后,当应用程序启动时,我会看到以下日志:

  • 我正在尝试使用下面的快速加载API 连接…等是完美的。 我确切地知道它在哪里失败 例外情况是 < code >线程“main”Java . lang . illegalstateexception中出现异常:示例失败。 这是我试图上传的表格。它是格式,当我通过记事本打开它时,它看起来像这样 为什么我会得到这个异常?我该如何改进?据我理解问题是< code > pstmtfld . setascii

  • 问题内容: 如何将轮询线程传递给另一个线程进行处理。程序执行在具有主方法和线程池的控制器类中: 主类控制器 具有轮询类的线程的方法 具有proc类的线程的方法 轮询类和控制器类 我的任务和问题是: 1.控制器应同时处理轮询器和处理器线程,并且应仅调用轮询器和处理器线程 2.现在我的问题是如何使轮询线程等待3秒并并行通知处理器。 我得到如下错误: 这里如何实现异步处理? 问题答案: 你需要阅读的东西