首页 > 其他分享 >spring报错

spring报错

时间:2023-07-03 16:11:59浏览次数:40  
标签:lang java spring springframework maven 报错 context org

C:\Users\dell\.jdks\openjdk-19.0.2\bin\java.exe "-javaagent:E:\idea图片\IntelliJ IDEA 2022.2.3\lib\idea_rt.jar=51567:E:\idea图片\IntelliJ IDEA 2022.2.3\bin" -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath C:\Users\dell\Desktop\学习\untitled4\target\classes;E:\maven\apache-maven-3.8.6\org\springframework\spring-context\4.0.0.RELEASE\spring-context-4.0.0.RELEASE.jar;E:\maven\apache-maven-3.8.6\org\springframework\spring-aop\4.0.0.RELEASE\spring-aop-4.0.0.RELEASE.jar;E:\maven\apache-maven-3.8.6\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;E:\maven\apache-maven-3.8.6\org\springframework\spring-beans\4.0.0.RELEASE\spring-beans-4.0.0.RELEASE.jar;E:\maven\apache-maven-3.8.6\org\springframework\spring-core\4.0.0.RELEASE\spring-core-4.0.0.RELEASE.jar;E:\maven\apache-maven-3.8.6\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar;E:\maven\apache-maven-3.8.6\org\springframework\spring-expression\4.0.0.RELEASE\spring-expression-4.0.0.RELEASE.jar org.example.APP2 7月 03, 2023 3:58:54 下午 org.springframework.context.support.AbstractApplicationContext prepareRefresh 信息: Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@3fb4f649: startup date [Mon Jul 03 15:58:54 CST 2023]; root of context hierarchy Exception in thread "main" java.lang.IllegalStateException: Cannot load configuration class: org.example.Config.Spring at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:378) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:263) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:265) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:126) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:609) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) at org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:84) at org.example.APP2.main(APP2.java:19) Caused by: java.lang.ExceptionInInitializerError at org.springframework.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:166) at org.springframework.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216) at org.springframework.cglib.core.KeyFactory$Generator.create(KeyFactory.java:144) at org.springframework.cglib.core.KeyFactory.create(KeyFactory.java:116) at org.springframework.cglib.core.KeyFactory.create(KeyFactory.java:108) at org.springframework.cglib.core.KeyFactory.create(KeyFactory.java:104) at org.springframework.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69) at org.springframework.context.annotation.ConfigurationClassEnhancer.newEnhancer(ConfigurationClassEnhancer.java:104) at org.springframework.context.annotation.ConfigurationClassEnhancer.enhance(ConfigurationClassEnhancer.java:92) at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:368) ... 7 more 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 @6d7b4f4c at java.base/java.lang.reflect.AccessibleObject.throwInaccessibleObjectException(AccessibleObject.java:387) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:363) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:311) at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:201) at java.base/java.lang.reflect.Method.setAccessible(Method.java:195) at org.springframework.cglib.core.ReflectUtils$2.run(ReflectUtils.java:56) at java.base/java.security.AccessController.doPrivileged(AccessController.java:318) at org.springframework.cglib.core.ReflectUtils.<clinit>(ReflectUtils.java:46) ... 18 more   进程已结束,退出代码1

报这个错误

现在也没看懂这个是什么问题,但是发现了项目中部署的问题

可能就是因为这个JDK版本过高,因为我把他改成8就可以了

 

标签:lang,java,spring,springframework,maven,报错,context,org
From: https://www.cnblogs.com/lin513/p/17523161.html

相关文章

  • Task Execution and Scheduling In SpringBoot
    开天辟地TaskExecutionandSchedulingIntheabsenceofanExecutorbeaninthecontext,SpringBootauto-configuresaThreadPoolTaskExecutorwithsensibledefaultsthatcanbeautomaticallyassociatedtoasynchronoustaskexecution(@EnableAsync)andSpr......
  • Java 常用注解@Configuration,@Bean及@ConfigurationProperties(prefix = "spring.data
    @ConfigurationpublicclassEventDataSourceConfig{@Bean(name="eventdataSource")@ConfigurationProperties(prefix="datasource.event")publicDataSourceoldDataSource(){returnDataSourceBuilder.create().build();......
  • 41. Spring Boot 使用Java代码创建Bean并注册到Spring中【从零开始学Spring Boot】
    已经好久没有讲一些基础的知识了,这一小节来点简单的,这也是为下节的在Spring多数Boot中使用多数据源做准备。从Spring3.0开始,增加了一种新的途径来配置BeanDefinition,这就是通过JavaCode配置BeanDefinition。      与XML和Annotation两种配置方式不同点在于:      ......
  • 34. Spring Boot的启动器Starter详解【从零开始学Spring Boot】
        SpringBoot应用启动器基本的一共有N(现知道的是44)种:具体如下: 1)spring-boot-starter这是SpringBoot的核心启动器,包含了自动配置、日志和YAML。2)spring-boot-starter-actuator帮助监控和管理应用。3)spring-boot-starter-amqp通过spring-rabbit来支持AMQP协议(AdvancedMess......
  • 32. Spring Boot使用@SpringBootApplication注解【从零开始学Spring Boot】
     如果看了我之前的文章,这个节你就可以忽略了,这个是针对一些刚入门的选手存在的困惑进行写的一篇文章。很多SpringBoot开发者总是使用@Configuration,@EnableAutoConfiguration和@ComponentScan注解他们的main类。由于这些注解被如此频繁地一块使用(特别是你遵循以上最佳实践时),S......
  • 29. Spring boot 文件上传(多文件上传)【从零开始学Spring Boot】
    文件上传主要分以下几个步骤:(1)新建mavenjavaproject;(2)在pom.xml加入相应依赖;(3)新建一个表单页面(这里使用thymeleaf);(4)编写controller;(5)测试;(6)对上传的文件做一些限制;(7)多文件上传实现(1)新建mavenjavaproject新建一个名称为spring-boot-fileuploadmavenjava项目;(2)在pom.xml......
  • springboot下的@NotBlank,@NotNull,@NotEmpty
    话不多说1.三个注解区别@NotBlank只能作用在String上,不能为null,而且调用trim()后,长度必须大于0(不能为空格)@NotNull不能为null,但可以为空字符串,校验Integer类型不能为空@NotEmpty不能为null,并且长度必须大于0,校验List类型不能为空2.依赖引入`<dependency> ......
  • 数据库中用户删除不掉总是报错,依赖如何处理干净?
    摘要:本文主要介绍如何进行用户的各种依赖识别与清理,并简单介绍下推荐的权限管理方式。本文分享自华为云社区《GaussDB(DWS)用户删除不掉时候总是报错,依赖如何处理干净?》,作者:Malick。数据库的使用中,有时会遇到某些用户离职,或者角色变更时,要对其账号进行销户,权限进行回收等操作......
  • Apache FtpServer Spring3 整合
    配置运行成功,以备遗忘。Spring配置当中加入 <importresource="applicationFTP.xml"/>在Spring配置同级目录创建 applicationFTP.xml<?xmlversion="1.0"encoding="UTF-8"?><serverxmlns="http://mina.apache.org/ftpserver/spring/v1"  ......
  • 基于 Spring Cloud Function 的 Azure Function 开发
    Notice:本文章不包含AzureFunction环境配置等内容1.1前提Azure账户,且有可使用的订阅Azure支持的JDK(本教程适用于JDK1.8)IntelliJIDEA社区版或无限制版均可Maven3.5+最新的FunctionCoreTools1.2创建SpringCloudFunctionAzure工程在Github仓......