1

I have used GFSH to start locator like below

start locator --name=gemfire_locator --security-properties-file="../config/gfsecurity.properties" --J=-Dgemfire.ssl-enabled-components=all --mcast-port=0 --J=-Dgemfire.jmx-manager-ssl=true

Also started server

start server --name=server1 --security-properties-file="../config/gfsecurity.properties" --J=-Dgemfire.ssl-enabled-components=all --mcast-port=0 --J=-Dgemfire.jmx-manager-ssl=true

I am trying to connect to Gemfire as ClientCache which works perfectly fine over SSL. But When I connect as JMX client, I am getting below error in Java code as well as Jconsole.

Error: 
Exception in thread "main" java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: non-JRMP server at remote endpoint]
    at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:369)
    at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270)
    at SamplePlugin.main(SamplePlugin.java:101)

Am I missing any other configuration?

Here is my JAVA_TOOL_OPTIONS:

-Dcom.sun.management.jmxremote 
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=true
-Djava.rmi.server.hostname=myhostname
Romeo Ninov
  • 6,538
  • 1
  • 22
  • 31
Ramya
  • 13
  • 4
  • You probably also need to set trust/keystore values for the client you're connecting with: `javax.net.ssl.keyStore`, `javax.net.ssl.keyStorePassword`, `javax.net.ssl.trustStore` and `javax.net.ssl.trustStorePassword`. – Jens D Feb 07 '19 at 16:12
  • In GFSH >> start jconsole --J=-Djavax.net.ssl.keyStore=../cert/trusted.keystore --J=-Djavax.net.ssl.keyStorePassword=password --J=-Djavax.net.ssl.trustStore=../cert/trusted.keystore --J=-Djavax.net.ssl.trustStorePassword=password Still same error – Ramya Feb 11 '19 at 06:53

1 Answers1

1

You will also need to add the geode-core jar to your classpath for jvisualvm. Use the --cp:a option. I would suggest just using geode-dependencies.jar as that will get everything you might need.

The reason this is required is explained a bit in the comments for ContextAwareSSLRMIClientSocketFactory. Basically it seems that when RMI uses SSL, the necessary RMIClientSocketFactory is exported from the server to the client for use there. In general this would simply just be SslRMIClientSocketFactory. But in our case, we have a custom socket factory and so the client (jvisualvm in this case) needs to have access to it.

Jens D
  • 4,229
  • 3
  • 16
  • 19