Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JMX auth + SSL do not work with version 1.0.1 #78

Open
abhijitdz opened this issue Feb 16, 2020 · 1 comment
Open

JMX auth + SSL do not work with version 1.0.1 #78

abhijitdz opened this issue Feb 16, 2020 · 1 comment

Comments

@abhijitdz
Copy link

java -Djavax.net.ssl.trustStore=/path/truststore.jks -Djavax.net.ssl.trustStorePassword=password -jar jmxterm-1.0.1-uber.jar -l service:jmx:rmi:///jndi/rmi://1.2.3.4:8099/jmxrmi -u foo -p foobar
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 org.cyclopsgroup.jmxterm.cc.SessionImpl.doConnect(SessionImpl.java:64)
at org.cyclopsgroup.jmxterm.cc.SessionImpl.connect(SessionImpl.java:39)
at org.cyclopsgroup.jmxterm.cc.CommandCenter.connect(CommandCenter.java:103)
at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:126)
at org.cyclopsgroup.jmxterm.boot.CliMain.main(CliMain.java:41)
Caused by: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: non-JRMP server at remote endpoint]
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:136)
at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:205)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1955)
at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1922)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:287)
... 6 more
Caused by: java.rmi.ConnectIOException: non-JRMP server at remote endpoint
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:248)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:338)
at sun.rmi.registry.RegistryImpl_Stub.lookup(RegistryImpl_Stub.java:112)
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:132)
... 11 more

With jconsole it works.

From an earlier issue, this was fixed in 1.0.1 ?

@nkxx
Copy link

nkxx commented Apr 8, 2020

Just tested with 1.0.0 and 1.0.1. It did not work in either case. However it does work with jconsole 13.0.2+8.

Here is the command used to launch:
java -Djavax.net.ssl.trustStore=/opt/app/keystore/keystore.jks -Djavax.net.ssl.trustStorePassword=tspassword -jar jmxterm-1.0.0-uber.jar -l myhost:20123 -u jmxusername -p jmxpassword -v verbose -n < script.txt

Here is the output when testing with 1.0.0

constituent[0]: jar:file:/opt/vertexcachecontrol/jmxterm-1.0.0-uber.jar!/WORLDS-INF/lib/jmxterm.jar
constituent[1]: jar:file:/opt/vertexcachecontrol/jmxterm-1.0.0-uber.jar!/WORLDS-INF/lib/commons-beanutils.jar
constituent[2]: jar:file:/opt/vertexcachecontrol/jmxterm-1.0.0-uber.jar!/WORLDS-INF/lib/commons-collections.jar
constituent[3]: jar:file:/opt/vertexcachecontrol/jmxterm-1.0.0-uber.jar!/WORLDS-INF/lib/commons-lang.jar
constituent[4]: jar:file:/opt/vertexcachecontrol/jmxterm-1.0.0-uber.jar!/WORLDS-INF/lib/commons-logging.jar
constituent[5]: jar:file:/opt/vertexcachecontrol/jmxterm-1.0.0-uber.jar!/WORLDS-INF/lib/commons-io.jar
constituent[6]: jar:file:/opt/vertexcachecontrol/jmxterm-1.0.0-uber.jar!/WORLDS-INF/lib/caff.jar
constituent[7]: jar:file:/opt/vertexcachecontrol/jmxterm-1.0.0-uber.jar!/WORLDS-INF/lib/jcli.jar
constituent[8]: jar:file:/opt/vertexcachecontrol/jmxterm-1.0.0-uber.jar!/WORLDS-INF/lib/jline.jar
constituent[9]: jar:file:/opt/vertexcachecontrol/jmxterm-1.0.0-uber.jar!/WORLDS-INF/lib/jmxremote_optional-repackaged.jar

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 org.cyclopsgroup.jmxterm.cc.SessionImpl.doConnect(SessionImpl.java:85)
at org.cyclopsgroup.jmxterm.cc.SessionImpl.connect(SessionImpl.java:49)
at org.cyclopsgroup.jmxterm.cc.CommandCenter.connect(CommandCenter.java:110)
at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:159)
at org.cyclopsgroup.jmxterm.boot.CliMain.main(CliMain.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:353)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:264)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.classworlds.uberjar.boot.Bootstrapper.bootstrap(Bootstrapper.java:209)
at org.codehaus.classworlds.uberjar.boot.Bootstrapper.main(Bootstrapper.java:116)
Caused by: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: non-JRMP server at remote endpoint]
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:136)
at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:205)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1955)
at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1922)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:287)
... 20 more
Caused by: java.rmi.ConnectIOException: non-JRMP server at remote endpoint
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:248)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:343)
at sun.rmi.registry.RegistryImpl_Stub.lookup(RegistryImpl_Stub.java:116)
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:132)
... 25 more

Here is the output when testing with 1.0.1
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 org.cyclopsgroup.jmxterm.cc.SessionImpl.doConnect(SessionImpl.java:64)
at org.cyclopsgroup.jmxterm.cc.SessionImpl.connect(SessionImpl.java:39)
at org.cyclopsgroup.jmxterm.cc.CommandCenter.connect(CommandCenter.java:103)
at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:126)
at org.cyclopsgroup.jmxterm.boot.CliMain.main(CliMain.java:41)
Caused by: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: non-JRMP server at remote endpoint]
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:136)
at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:205)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1955)
at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1922)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:287)
... 6 more
Caused by: java.rmi.ConnectIOException: non-JRMP server at remote endpoint
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:248)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:343)
at sun.rmi.registry.RegistryImpl_Stub.lookup(RegistryImpl_Stub.java:116)
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:132)
... 11 more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants