-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nacos 2.4.1 在 JDK 8 中运行正常,在 JDK 17/22 运行异常 #12498
Comments
I do not think server is support JDK17/22 |
这个参数应该JVM参数设置,一般不是用在jar包执行时可以加上?我是通过sh startup.sh运行的,请问如何加上述参数 @xuxiaowei-com-cn |
# start
echo "$JAVA $JAVA_OPT_EXT_FIX ${JAVA_OPT}" > ${BASE_DIR}/logs/start.out 2>&1 &
JAVA_OPEN_OPTION="--add-opens java.base/java.lang=ALL-UNNAMED" # 手动添加
if [[ "$JAVA_OPT_EXT_FIX" == "" ]]; then
nohup "$JAVA" ${JAVA_OPEN_OPTION} ${JAVA_OPT} nacos.nacos >> ${BASE_DIR}/logs/start.out 2>&1 &
else
nohup "$JAVA" ${JAVA_OPEN_OPTION} "$JAVA_OPT_EXT_FIX" ${JAVA_OPT} nacos.nacos >> ${BASE_DIR}/logs/start.out 2>&1 &
fi |
看起来是hessain序列化的时候,随着jdk的升级,部分反射操作可能不兼容了, 如果能通过一些jvm参数支持是最好的, 否则只能升级hassain的版本了。 |
加上 |
Environment
Solutionadd this method into "startup.sh", will start successfully without error log
tips
|
和hessian关系不大,主要是因为nacos配置为JDK1.8,而JDK17+开始使用按模块引入包语法,不兼容之前的语法,不过一定要运行的话可以加入以下命令: |
Closed by #12565 |
--add-opens java.base/java.lang=ALL-UNNAMED
The text was updated successfully, but these errors were encountered: