Open pshipton opened 6 years ago
Using the same version on IBM Java works
Mar 26, 2018 6:28:30 PM com.ibm.java.diagnostics.healthcenter.agent.mbean.HCLaunchMBean <init>
INFO: Agent version "3.0.14.20171017"
Mar 26, 2018 6:28:31 PM com.ibm.java.diagnostics.healthcenter.agent.mbean.HCLaunchMBean createJMXConnector
INFO: IIOP will be listening on the next available system assigned port. Use com.ibm.java.diagnostics.healthcenter.agent.iiop.port to specify a port
Mar 26, 2018 6:28:31 PM com.ibm.java.diagnostics.healthcenter.agent.mbean.HCLaunchMBean startAgent
INFO: Health Center agent started on port 1972.
The error looks very similar to: https://www.ibm.com/developerworks/community/forums/html/topic?id=ac3e5db4-fba9-4348-a213-2a08feb6625d&ps=10
and https://xap-issues.atlassian.net/browse/XAP-13167 which offers a potential workaround which massaged a bit to the following might work:
-Dsun.rmi.registry.registryFilter=java.**;javax.**;com.ibm.**
-Dsun.rmi.registry.registryFilter=java.**;javax.**;com.ibm.**
works
bin/java "-Dsun.rmi.registry.registryFilter=java.**;javax.**;com.ibm.**" -Xhealthcenter
Mar 26, 2018 11:27:18 PM com.ibm.java.diagnostics.healthcenter.agent.mbean.HCLaunchMBean <init>
INFO: Agent version "3.0.14.20171017"
Mar 26, 2018 11:27:18 PM com.ibm.java.diagnostics.healthcenter.agent.mbean.HCLaunchMBean createJMXConnector
INFO: IIOP will be listening on the next available system assigned port. Use com.ibm.java.diagnostics.healthcenter.agent.iiop.port to specify a port
Mar 26, 2018 11:27:18 PM com.ibm.java.diagnostics.healthcenter.agent.mbean.HCLaunchMBean startAgent
INFO: Health Center agent started on port 1972.
works
I didn't notice earlier, but the OpenJ9 VM didn't exit when the healthcenter agent was started, but it should have.
-Dsun.rmi.registry.registryFilter=javax.**
is sufficient to avoid the stack trace initially reported.
Tagging in @tobespc for awareness
Tried an OpenJ9 0.11 build and the status has not changed.
The workaround -Dsun.rmi.registry.registryFilter=javax.**
is still required for the healthcenter agent to start. With this workaround the JVM starts, but does not exit/stop.
I'll just mention here that somebody noted there isn't currently any healthcenter agent for OSX.
Note that in my tests at https://github.com/AdoptOpenJDK/openjdk-build/issues/692#issuecomment-476370646, -Dsun.rmi.registry.registryFilter*
was not needed and the JVM does stop gracefully.
@kgibm I seem to need -Dsun.rmi.registry.registryFilter=javax.**
when using jdk8 on win10 system, and the process will not stop automatically.
If I use jdk12 and add the system variable CLASSPATH=F:\wa64\lib\ext\healthcenter.jar
then run java -Xhealthcenter -version
will get an error
PS D:\AdoptOpenJDK\jdk-12+33\bin> ./java -Xhealthcenter -version
3月 27, 2019 12:04:48 上午 com.ibm.java.diagnostics.healthcenter.agent.mbean.HCLaunchMBean <init>
信息: Agent version "3.0.11.20161017"
3月 27, 2019 12:04:48 上午 com.ibm.java.diagnostics.healthcenter.agent.mbean.HCLaunchMBean createJMXConnector
信息: IIOP will be listening on the next available system assigned port. Use com.ibm.java.diagnostics.healthcenter.agent.iiop.port to specify a port
3月 27, 2019 12:04:48 上午 com.ibm.java.diagnostics.healthcenter.agent.mbean.HCLaunchMBean createJMXConnector
严重: Health Center agent failed to start.
java.net.MalformedURLException: Unsupported protocol: iiop
at java.management/javax.management.remote.JMXConnectorServerFactory.newJMXConnectorServer(JMXConnectorServerFactory.java:320)
at com.ibm.java.diagnostics.healthcenter.agent.mbean.HCLaunchMBean.createJMXConnector(HCLaunchMBean.java:673)
at com.ibm.java.diagnostics.healthcenter.agent.mbean.HCLaunchMBean.startMBeanServer(HCLaunchMBean.java:462)
at com.ibm.java.diagnostics.healthcenter.agent.mbean.HCLaunchMBean$JmxStarterThread.run(HCLaunchMBean.java:267)
3月 27, 2019 12:04:48 上午 com.ibm.java.diagnostics.healthcenter.agent.mbean.HCLaunchMBean startAgent
信息: Health Center agent did not start correctly.
openjdk version "12" 2019-03-19
OpenJDK Runtime Environment AdoptOpenJDK (build 12+33)
Eclipse OpenJ9 VM AdoptOpenJDK (build openj9-0.13.0, JRE 12 Windows 10 amd64-64-Bit Compressed References 20190320_32 (JIT enabled, AOT enabled)
OpenJ9 - caeb51f87
OMR - 33a33ff2
JCL - 419f571019 based on jdk-12+33)
@Flandoll It's not beautiful, but you could try -Xbootclasspath
instead of CLASSPATH
as per my comment in the other issue.
FWIW, this is what I did to get HealthCenter running on a Java 11 build. It also works to get the latest agent for OpenJ9 Java 8, just copy the files to the same directories (i.e. jre/bin to jre/bin, jre/lib to jre/lib, jre/lib/ext to jre/lib/ext). On Java 8, changing from iiop isn't required, nor the -Xbootclasspath/a:
option.
Download a recent IBM Java 8 build from https://developer.ibm.com/javasdk/downloads/sdk8/
Copy the following files from the Java 8 build to the Java 11 build. jre/bin/healthcenter.dll to bin jre/bin/hcapiplugin.dll to bin jre/lib/healthcenter.properties to lib jre/lib/ext/healthcenter.jar to lib
Edit the healthcenter.properties file and set
com.ibm.java.diagnostics.healthcenter.agent.transport=jrmp
since iiop doesn't work for Java 11.
The configuration reference is https://www.ibm.com/support/knowledgecenter/en/SS3KLZ/com.ibm.java.diagnostics.healthcenter.doc/topics/configproperties.html
Enable it as follows
bin\java -Xhealthcenter -Xbootclasspath/a:lib/healthcenter.jar -Dsun.rmi.registry.registryFilter=javax.**
See https://github.com/eclipse/openj9/pull/12262 and related pull requests.
Copy the following files from the Java 8 build to the Java 11 build. jre/bin/healthcenter.dll to bin jre/bin/hcapiplugin.dll to bin jre/lib/healthcenter.properties to lib jre/lib/ext/healthcenter.jar to lib
Another user hit some issues trying the workaround on Linux:
lib
rather than bin
on Linux, and-Xbootclasspath/a
must be an absolute path if java
isn't started from $JAVA_HOME
Example with OpenLiberty and Semeru 11 on Linux:
$ podman run --rm -v /mnt/host:/mnt/host --user root -it icr.io/appcafe/open-liberty:full-java11-openj9-ubi bash
[...]
$ cp -r /mnt/host/work/ibmjava/linux/8.0.7.16/jre/ibm-java-x86_64-80/ /tmp/
$ cp /tmp/ibm-java-x86_64-80/jre/lib/amd64/libhealthcenter.so /opt/java/openjdk/lib/
$ cp /tmp/ibm-java-x86_64-80/jre/lib/amd64/libhcapiplugin.so /opt/java/openjdk/lib/
$ cp /tmp/ibm-java-x86_64-80/jre/lib/healthcenter.properties /opt/java/openjdk/lib/
$ cp /tmp/ibm-java-x86_64-80/jre/lib/ext/healthcenter.jar /opt/java/openjdk/lib/
$ printf -- "-Xhealthcenter:level=headless\n-Xbootclasspath/a:/opt/java/openjdk/lib/healthcenter.jar\n-Dsun.rmi.registry.registryFilter=javax.**\n" > /config/jvm.options
$ sed -i 's/transport=iiop/transport=jrmp/g' /opt/java/openjdk/lib/healthcenter.properties
$ /opt/ol/wlp/bin/server run
[Tue 18 Oct 2022 04:06:22 PM UTC] com.ibm.diagnostics.healthcenter.headless INFO: 4.0.1
Tried it on Windows, installing the wa64-3.0.14.20171017 agent.
java -Xhealthcenter results in the following