From 8d40209e3607a77c7a4e92784093368749f3de86 Mon Sep 17 00:00:00 2001 From: Tiewei Fang <43782773+BePPPower@users.noreply.github.com> Date: Mon, 8 Jan 2024 12:10:33 +0800 Subject: [PATCH] [Fix](JDK) Start Fe with JDK17 (#29658) --- conf/fe.conf | 2 +- .../src/main/java/org/apache/doris/persist/gson/GsonUtils.java | 2 ++ fe/pom.xml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/conf/fe.conf b/conf/fe.conf index a8d30963890979..4bae10ef2242fc 100644 --- a/conf/fe.conf +++ b/conf/fe.conf @@ -39,7 +39,7 @@ JAVA_OPTS="-Djavax.security.auth.useSubjectCredsOnly=false -Xss4m -Xmx8192m -XX: JAVA_OPTS_FOR_JDK_9="-Djavax.security.auth.useSubjectCredsOnly=false -Xss4m -Xmx8192m -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -Xlog:gc*:$DORIS_HOME/log/fe.gc.log.$CUR_DATE:time -Dlog4j2.formatMsgNoLookups=true" # For jdk 16+, this JAVA_OPTS will be used as default JVM options -JAVA_OPTS_FOR_JDK_16="-Djavax.security.auth.useSubjectCredsOnly=false -XX:+UseZGC -Xmx8192m -Xms8192m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$DORIS_HOME/log/ -Xlog:gc*:$DORIS_HOME/log/fe.gc.log.$CUR_DATE:time --add-opens java.base/java.util.concurrent.locks=ALL-UNNAMED --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.ref=ALL-UNNAMED --add-opens java.base/java.util.regex=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED" +JAVA_OPTS_FOR_JDK_16="-Djavax.security.auth.useSubjectCredsOnly=false -XX:+UseZGC -Xmx8192m -Xms8192m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$DORIS_HOME/log/ -Xlog:gc*:$DORIS_HOME/log/fe.gc.log.$CUR_DATE:time" ## ## the lowercase properties are read by main program. diff --git a/fe/fe-core/src/main/java/org/apache/doris/persist/gson/GsonUtils.java b/fe/fe-core/src/main/java/org/apache/doris/persist/gson/GsonUtils.java index 95071a4305154e..607bfe0ee4fdbb 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/persist/gson/GsonUtils.java +++ b/fe/fe-core/src/main/java/org/apache/doris/persist/gson/GsonUtils.java @@ -126,6 +126,7 @@ import com.google.gson.JsonParseException; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; +import com.google.gson.ReflectionAccessFilter; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; @@ -300,6 +301,7 @@ public class GsonUtils { // Add any other adapters if necessary. private static final GsonBuilder GSON_BUILDER = new GsonBuilder().addSerializationExclusionStrategy( new HiddenAnnotationExclusionStrategy()).enableComplexMapKeySerialization() + .addReflectionAccessFilter(ReflectionAccessFilter.BLOCK_INACCESSIBLE_JAVA) .registerTypeHierarchyAdapter(Table.class, new GuavaTableAdapter()) .registerTypeHierarchyAdapter(Multimap.class, new GuavaMultimapAdapter()) .registerTypeAdapterFactory(new PostProcessTypeAdapterFactory()) diff --git a/fe/pom.xml b/fe/pom.xml index e0018b8c1816c8..51157e3008284c 100644 --- a/fe/pom.xml +++ b/fe/pom.xml @@ -239,7 +239,7 @@ under the License. 1.5.1 1.10.0 1.7 - 2.8.9 + 2.10.1 32.1.2-jre 2.15.2 0.11-a-czt02-cdh