Skip to content

Commit

Permalink
Fixes #24136 - Exception when enabling a Monitoring Service
Browse files Browse the repository at this point in the history
Since OpenJDK 9, attaching of an agent to the current JVM has to be enabled by a system property.
See https://bugs.openjdk.org/browse/JDK-8180425
Signed-off-by:Ondro Mihalyi <mihalyi@omnifish.ee>
  • Loading branch information
OndroMih committed Nov 28, 2022
1 parent f8f139f commit dd06c97
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions appserver/admin/template/src/main/resources/config/domain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@
<jvm-options>--add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED</jvm-options>
<jvm-options>--add-exports=java.base/jdk.internal.vm.annotation=ALL-UNNAMED</jvm-options>
<jvm-options>--add-opens=java.base/jdk.internal.vm.annotation=ALL-UNNAMED</jvm-options>

<!-- To enable attaching the flashlight agent to the current VM in OpenJDK 9+ -->
<jvm-options>-Djdk.attach.allowAttachSelf=true</jvm-options>
</java-config>
<network-config>
<protocols>
Expand Down Expand Up @@ -411,6 +414,9 @@
<jvm-options>--add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED</jvm-options>
<jvm-options>--add-exports=java.base/jdk.internal.vm.annotation=ALL-UNNAMED</jvm-options>
<jvm-options>--add-opens=java.base/jdk.internal.vm.annotation=ALL-UNNAMED</jvm-options>

<!-- To enable attaching the flashlight agent to the current VM in OpenJDK 9+ -->
<jvm-options>-Djdk.attach.allowAttachSelf=true</jvm-options>
</java-config>
<availability-service>
<web-container-availability/>
Expand Down
5 changes: 5 additions & 0 deletions nucleus/admin/template/src/main/resources/config/domain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@
<jvm-options>--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED</jvm-options>
<jvm-options>--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED</jvm-options>
<jvm-options>--add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED</jvm-options>

<!-- To enable attaching the flashlight agent to the current VM in OpenJDK 9+ -->
<jvm-options>-Djdk.attach.allowAttachSelf=true</jvm-options>
</java-config>
<network-config>
<protocols>
Expand Down Expand Up @@ -332,6 +335,8 @@
<jvm-options>--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED</jvm-options>
<jvm-options>--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED</jvm-options>
<jvm-options>--add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED</jvm-options>
<!-- To enable attaching the flashlight agent to the current VM in OpenJDK 9+ -->
<jvm-options>-Djdk.attach.allowAttachSelf=true</jvm-options>
</java-config>
<availability-service/>
<network-config>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public static Logger getLogger() {
public static final String MISSING_AGENT_JAR_DIR = LOGMSG_PREFIX + "-00503";

@LogMessageInfo(
message = "Encountered exception during agent attach",
message = "Encountered exception during agent attach: {0}",
level = "WARNING")
public static final String ATTACH_AGENT_EXCEPTION = LOGMSG_PREFIX + "-00504";

Expand Down

0 comments on commit dd06c97

Please sign in to comment.