我正在嘗試使用 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) ~[?:?] 在 org.springframework.aop 處為空.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) ~[spring-aop-4.3.25.RELEASE.jar:4.3.25.RELEASE] 在 org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java) 190) ~[spring-aop-4.3.25.RELEASE.jar:4.3.25.RELEASE] 在 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]
有任何想法嗎 ?謝謝
uj5u.com熱心網友回復:
Spring 4.3 與 Java 6 到 8 兼容,更高版本沒有經過測驗,因此不受支持。
有關具有 JDK 兼容性的 Spring 版本串列,請參閱Spring/JDK Compatibility Matrix。
要使用 JDK17 運行,您需要升級到 Spring 5.3。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/360879.html
標籤:爪哇 春天 openjdk-17
