0

我正在尝试使用 jdk17 运行 java 8 批处理,该项目是使用 jre1.8.0_192 构建的,我在 VM 中放置了以下选项:

--add-modules=ALL-SYSTEM --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.math=ALL-UNNAMED --add-opens=java .base/java.net=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=jdk.attach/sun.tools.attach=ALL-UNNAMED -Djava.locale .providers=JRE,SPI

我在运行时收到以下错误:

java.lang.NullPointerException:无法调用“Object.getClass()”,因为“obj”在 java.lang.reflect.Method.invoke(Method.java:561) ~[?:?] at org.springframework.aop 处为空.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) ~[spring-aop-4.3.25.RELEASE.jar:4.3.25.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java: 190)~[spring-aop-4.3.25.RELEASE.jar:4.3.25.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)~[spring-aop-4.3.25 .RELEASE.jar:4.3.25.RELEASE] 在 org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$PassthruAdvice.invoke(SimpleBatchConfiguration.java:127) ~[spring-batch-core-3.0.10.RELEASE. jar:3.0.10.RELEASE] 在 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.25.RELEASE.jar:4.3.25.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy .java:213) ~[spring-aop-4.3.25.RELEASE.jar:4.3.25.RELEASE]

有任何想法吗 ?谢谢

4

1 回答 1

0

Spring 4.3 与 Java 6 到 8 兼容,更高版本未经测试,因此不受支持。

有关具有 JDK 兼容性的 Spring 版本列表,请参阅Spring/JDK Compatibility Matrix

要使用 JDK17 运行,您需要升级到 Spring 5.3。

于 2021-11-18T10:22:18.003 回答