On 1/13/11 5:09 PM, Ziggy wrote: > Given that Jconsole can connect to the Tomcat JMX without any user > credentials (locally), i am guessing that i dont need to supply these > credentials but how do i connect to the JMX server without supplying the > port number? (by specifying the port number it means i am allowing remote > authentication meaning i have to provide the login credentials).
You've configured JMX to listen on a port and be protected by a password, if you are connecting to a port you must therefor supply a password. If, instead, you want to use the Attach API (an experimental package in Java 6), you can connect to a local Java process directly, using the localConnectorStub. The Attach API is the mechanism used by JConsole, jps and VisualVM. There is code in the below project which illustrates this. Look for AbstractJMXCommand. p >> From my own efforts: >> >> https://github.com/pidster/Tomcat-CLI >> >> >> p >> >> >> >>>>> 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); >>>>> } >> >
0x62590808.asc
Description: application/pgp-keys
signature.asc
Description: OpenPGP digital signature