Legacy Knowledge Base
公開されました Jul. 2, 2025

JDK11使用時に "Inaccessible Object "例外が発生する。

Written By

Joel Garman

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

説明

Linux環境でJDK11を使用し、LCS 5.0.0クライアントを導入している場合、起動時に以下のエラーが発生する場合があります:

ERROR [LCS Worker 2][BaseScheduledTask:92] java.lang.reflect.InaccessibleObjectException: Unable to make public long com.sun.management.internal.OperatingSystemImpl.getOpenFileDescriptorCount() accessible: module jdk.management does not
 "opens com.sun.management.internal" to unnamed module @1a3325e5
java.lang.reflect.InaccessibleObjectException: Unable to make public long com.sun.management.internal.OperatingSystemImpl.getOpenFileDescriptorCount() accessible: module jdk.management does not "opens com.sun.management.internal" to unnamed module @1a3325e5
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:198) at java.base/java.lang.reflect.Method.setAccessible(Method.java:192)

解決

このエラーは、JDK11が最近互換性マトリックスに追加されたために発生します。 TomcatとWildflyのアプリサーバーでは、以下のような回避策があります。

JDK11に移行する場合は、 JDK 11使用時の "Illegal Access "警告について の記事もご参考ください。

Tomcat

不正アクセスの警告メッセージを回避するために、これらのプロパティをTomcatに追加します(例:tomcat/bin/setenv.sh):

CATALINA_OPTS=
CATALINA_OPTS="$CATALINA_OPTS --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED"

Wildfly

不正アクセス警告メッセージを回避するために、Wildflyにこれらのプロパティを追加します(例:wildfly/bin/standalone.conf):

JAVA_OPTS="$JAVA_OPTS --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED"
Did this article resolve your issue ?

Legacy Knowledge Base