While running jconsole i receive:
The connection did not succeed.
I can see the open port on server with netstat. When i try to add item to zabbix (processing time), it gives me info:
attempt to add a Permission to a readonly Permissions object.
I’ve also tried changing sonar.ce.javaAdditionalOpts to sonar.ce.javaOpts, nothing changed.
When I do same for webserver, it works good.
My java on server:
OpenJDK 11.0.6+10-LTS
I was able to reproduce the problem.
I suspect that the Security Manager in the CE is interfering with the JMX server.
Using jconsole -debug I get the following exception:
java.lang.SecurityException: attempt to add a Permission to a readonly Permissions
objectjava.lang.SecurityException: attempt to add a Permission to a readonly Permissions object at
java.base/java.security.Permissions.add(Permissions.java:128) at
java.base/java.security.Policy$UnsupportedEmptyCollection.add(Policy.java:843) at
java.rmi/sun.rmi.server.LoaderHandler.getLoaderAccessControlContext(LoaderHandler.java:1005) at
java.rmi/sun.rmi.server.LoaderHandler.lookupLoader(LoaderHandler.java:881) at
java.rmi/sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:404) at
java.rmi/sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:186) at
java.rmi/java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:637) at
java.rmi/java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:264) at
java.rmi/sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:213) at
java.base/java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1886) at
java.base/java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1772) at
java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2060) at
java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1594) at
java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:430) at
java.rmi/sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:322) at
java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:339) at
java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200) at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197) at
java.base/java.security.AccessController.doPrivileged(Native Method) at
java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196) at
java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562) at
java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796) at
java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:67
7) at java.base/java.security.AccessController.doPrivileged(Native Method) at
java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676) at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at
java.base/java.lang.Thread.run(Thread.java:834) at
java.rmi/sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:
283) at java.rmi/sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:260) at
java.rmi/sun.rmi.server.UnicastRef.invoke(UnicastRef.java:161) at
jdk.remoteref/jdk.jmx.remote.internal.rmi.PRef.invoke(Unknown Source) at
java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl_Stub.isRegistered(Unknown Source) at
java.management.rmi/javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.isRegistered(RMIConnector.java:865) at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at
jdk.jconsole/sun.tools.jconsole.ProxyClient$SnapshotInvocationHandler.invoke(ProxyClient.java:992) at jdk.proxy1/com.sun.proxy.jdk.proxy1.$Proxy0.isRegistered(Unknown Source) at
jdk.jconsole/sun.tools.jconsole.ProxyClient.tryConnect(ProxyClient.java:380) at
jdk.jconsole/sun.tools.jconsole.ProxyClient.connect(ProxyClient.java:313) at
jdk.jconsole/sun.tools.jconsole.VMPanel$2.run(VMPanel.java:296)