On 1/13/11 3:15 PM, Ziggy wrote: > Aha... i didnt realise that i needed to supply the credentials from the > client. I thought Tomcat would get those from the password files. Ok im off > to the documentation now. :)
It could do, but you'd have to point the client at those files and read
their contents too.
>>> try {
>>> url = new
>>> JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:18070/jmxrmi");
>>> jmxc = JMXConnectorFactory.connect(url,null);
Map<String, Object> environment = new HashMap<String, Object>();
String[] pair = new String[] { "username", "password" };
environment.put(JMXConnector.CREDENTIALS, pair);
jmxc = JMXConnectorFactory.connect(url, environment);
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
