一.问题:
java.lang.ExceptionInInitializerError: nullat java.base/java.lang.Class.forName0(Native Method)at java.base/java.lang.Class.forName(Class.java:375)。。。。。。内部保密。。。。at org.springframework.context.annotation.ParserStrategyUtils.invokeAwareMethods(ParserStrategyUtils.java:132)at org.springframework.context.annotation.ParserStrategyUtils.instantiateClass(ParserStrategyUtils.java:66)at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:590)at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:582)at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:310)at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:249)at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:206)at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:174)at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331)at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247)at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311)at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112)at org.springframework.context.support.AbstractApplicat
二.本地环境
macM2, java8+springboot2.3, 现在要升级。
java8-->openjdk17(免费呀)
springboot2.3-->springboot2.7.9
三.如何解决?不废话
ps:我用的社区版idea2024.1。
点击idea-run-edit, modify options, 添加以下jvm 参数即可。
为啥这么多?这是一个相对比较全的,升级4个应用的经验,
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/jdk.internal.misc=ALL-UNNAMED
--add-opens java.base/jdk.internal.loader=ALL-UNNAMED
--add-opens java.base/sun.security.action=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
--add-opens java.base/sun.util.calendar=ALL-UNNAMED
--add-opens java.base/sun.nio.ch=ALL-UNNAMED
--add-opens java.base/java.net=ALL-UNNAMED
--add-opens java.base/java.nio=ALL-UNNAMED
--add-opens java.base/java.math=ALL-UNNAMED
--add-opens java.base/java.time=ALL-UNNAMED
--add-opens java.base/java.security=ALL-UNNAMED--add-opens java.management/java.lang.management=ALL-UNNAMED
--add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED
--add-opens java.management/sun.management=ALL-UNNAMED--add-opens java.base/java.util.concurrent.locks=ALL-UNNAMED
--add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED