You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2022/02/23 03:06:51 UTC

[iotdb] branch IOTDB_2593 created (now 5ea89d9)

This is an automated email from the ASF dual-hosted git repository.

haonan pushed a change to branch IOTDB_2593
in repository https://gitbox.apache.org/repos/asf/iotdb.git.


      at 5ea89d9  [IOTDB-2593] Fix cannot insert data using JDK17

This branch includes the following new commits:

     new 5ea89d9  [IOTDB-2593] Fix cannot insert data using JDK17

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[iotdb] 01/01: [IOTDB-2593] Fix cannot insert data using JDK17

Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

haonan pushed a commit to branch IOTDB_2593
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 5ea89d91356596a368e2745a34fd4afbcb876b9c
Author: HTHou <hh...@outlook.com>
AuthorDate: Wed Feb 23 11:06:01 2022 +0800

    [IOTDB-2593] Fix cannot insert data using JDK17
---
 server/src/assembly/resources/conf/iotdb-env.sh    | 14 ++++++++++++++
 server/src/assembly/resources/sbin/start-server.sh |  2 +-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/server/src/assembly/resources/conf/iotdb-env.sh b/server/src/assembly/resources/conf/iotdb-env.sh
index 342ec15..69b3aae 100755
--- a/server/src/assembly/resources/conf/iotdb-env.sh
+++ b/server/src/assembly/resources/conf/iotdb-env.sh
@@ -176,6 +176,7 @@ if [ "${version_arr[0]}" = "1" ] ; then
             IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -Xloggc:${IOTDB_HOME}/logs/gc.log  -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintGCApplicationStoppedTime -XX:+PrintPromotionFailure -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=10M"
         fi
     fi
+    illegal_access_params=""
 else
     #JDK 11 and others
     MAJOR_VERSION=${version_arr[0]}
@@ -189,6 +190,19 @@ else
             IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -Xlog:gc=info,heap*=info,age*=info,safepoint=info,promotion*=info:file=${IOTDB_HOME}/logs/gc.log:time,uptime,pid,tid,level:filecount=10,filesize=10485760"
         fi
     fi
+    # Add argLine for Java 16 and above, due to [JEP 396: Strongly Encapsulate JDK Internals by Default] (https://openjdk.java.net/jeps/396)
+    illegal_access_params="--illegal-access=permit"
+    illegal_access_params="$illegal_access_params --add-opens=java.base/java.util.concurrent=ALL-UNNAMED"
+    illegal_access_params="$illegal_access_params --add-opens=java.base/java.lang=ALL-UNNAMED"
+    illegal_access_params="$illegal_access_params --add-opens=java.base/java.util=ALL-UNNAMED"
+    illegal_access_params="$illegal_access_params --add-opens=java.base/java.nio=ALL-UNNAMED"
+    illegal_access_params="$illegal_access_params --add-opens=java.base/java.io=ALL-UNNAMED"
+    illegal_access_params="$illegal_access_params --add-opens=java.base/java.net=ALL-UNNAMED"
+    illegal_access_params="$illegal_access_params --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"
+    illegal_access_params="$illegal_access_params --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"
+    illegal_access_params="$illegal_access_params --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED"
+    illegal_access_params="$illegal_access_params --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED"
+    illegal_access_params="$illegal_access_params --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED"
 fi
 
 
diff --git a/server/src/assembly/resources/sbin/start-server.sh b/server/src/assembly/resources/sbin/start-server.sh
index a4d58fc..c1c44f3 100755
--- a/server/src/assembly/resources/sbin/start-server.sh
+++ b/server/src/assembly/resources/sbin/start-server.sh
@@ -72,7 +72,7 @@ launch_service()
 	iotdb_parms="$iotdb_parms -DIOTDB_CONF=${IOTDB_CONF}"
 	iotdb_parms="$iotdb_parms -DTSFILE_CONF=${IOTDB_CONF}"
 	iotdb_parms="$iotdb_parms -Dname=iotdb\.IoTDB"
-	exec "$JAVA" $iotdb_parms $IOTDB_JMX_OPTS -cp "$CLASSPATH" "$class" $CONF_PARAMS
+	exec "$JAVA" $illegal_access_params $iotdb_parms $IOTDB_JMX_OPTS -cp "$CLASSPATH" "$class" $CONF_PARAMS
 	return $?
 }