Note that there are some explanatory texts on larger screens.

plurals
  1. POConnection to Tomcat JMX server failing
    primarykey
    data
    text
    <p>Failing to connect to Tomcat JMX instance</p> <p>Ok i am stuck now - Im trying to configure JMX with Tomcat as follows</p> <p><code>$CATALINA_BASE/setenv.sh</code>:</p> <pre><code>CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=18070 -Dcom.sun.management.jmxremote.password.file=$CATALINA_BASE/conf/jmxremote.password -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.access.file=$CATALINA_BASE/conf/jmxremote.access" export CATALINA_OPTS </code></pre> <p><code>$CATALINA_BASE/conf/jmxremote.password</code></p> <pre><code> monitorRole monitorpass controlRole controlpass </code></pre> <p><code>$CATALINA_BASE/conf/jmxremote.access</code></p> <pre><code> monitorRole readonly controlRole readwrite </code></pre> <p>The client tool i am using to access the Tomcat JMX server is running on the same machine as the Tomcat instance. when i start tomcat i can see that there is something listening at port 18070 but when i try to connect i get the following error</p> <pre><code> Exception in thread "main" java.lang.SecurityException: Authentication failed! Credentials required at com.sun.jmx.remote.security.JMXPluggableAuthenticator.authenticationFailure(JMXPluggableAuthenticator.java:193) at com.sun.jmx.remote.security.JMXPluggableAuthenticator.authenticate(JMXPluggableAuthenticator.java:145) at sun.management.jmxremote.ConnectorBootstrap$AccessFileCheckerAuthenticator.authenticate(ConnectorBootstrap.java:185) at javax.management.remote.rmi.RMIServerImpl.doNewClient(RMIServerImpl.java:213) </code></pre> <p>I connect using the following bit of code</p> <pre><code> try { url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:18070/jmxrmi"); jmxc = JMXConnectorFactory.connect(url,null); mbsc = jmxc.getMBeanServerConnection(); } catch (MalformedURLException e) { throw new Exception(methodName + ":" + e); } catch (IOException e) { throw new Exception(methodName + ":" + "Failed to connect to the Tomcat Server " + e); } </code></pre> <p>It works fine if i set com.sun.management.jmxremote.authenticate=true to false. Other than that it just fails. The client tool is running on the same machine as the tomcat instance so there should not be any issues with the firewall. Any clues </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload