-
15. Re: JMX remote monitoring in AS7
ejroberts Mar 1, 2012 10:13 AM (in response to ejroberts)Ok, using the jconsole script from the bin directory in AS7.1 works with or without the user name and password.
Thanks guys! and apologies for missing the jconsole classpath requirements
-
16. Re: JMX remote monitoring in AS7
dkamenov Mar 1, 2012 4:49 PM (in response to mackerman)I am afraid it doesn't work for me. I got as far as to connect to JMX but the console spits this out on STDERR:
Mar 1, 2012 3:45:57 PM org.jboss.remoting3.remote.RemoteConnection handleException
ERROR: JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
I am using an admin user/password which works in jboss-cli.sh
Any ideas?
-
17. Re: JMX remote monitoring in AS7
hschmidt Mar 2, 2012 3:43 AM (in response to ctomc)Hi,
Connecting to "service:jmx:remoting-jmx://localhost:9999" works only in standalone mode for me.
Yet, I am not able to connect to jboss 7.1 running in domain mode. Is there something that has to be configured first?
Thanks
-
18. Re: JMX remote monitoring in AS7
dlofthouse Mar 2, 2012 5:37 AM (in response to hschmidt)Hi guys - can you all please start your own threads for your current environment / issue - having multiple users in the same thread gets overly complicated - so far all of these issues have been identified as local configuration issues so we need to review the local configuration of each independently.
-
19. Re: JMX remote monitoring in AS7
andy.miller Mar 22, 2012 1:26 PM (in response to ejroberts)I think I finally figured out why everyone is a little confused, as the document that Darran pointed to is accurate, but a little unclear for the remote case. What you have to do, is on the server/workstation/laptop where you are running JConsole, you have to start JConsole with the jconsole.sh script from a JBoss installation. Then without any other configuration on the server/workstation/laptop where you have the JBoss AS you want to connect to, you can connect using the URL described in the document, and the username/password of the administrator user you created for the console. So, for example:
System A, where I want to run JConsole:
cd <installation-path>jboss-as-7.1.0.Final/bin
make sure JAVA_HOME is set correctly
./jconsole.sh
server:jmx:remoting-jmx://<System B>:9999
username/password <- The same user you setup to access the console.
System B, where you have a running jboss as you want to attach to.
-
20. Re: JMX remote monitoring in AS7
smswamy Jun 29, 2012 9:32 AM (in response to andy.miller)Hi, this is working fine using JConsole but if I try the same using Java Code, I am getting
Jun 29, 2012 2:27:56 PM org.jboss.remoting3.remote.RemoteConnection handleException
ERROR: JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:315)
at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:214)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189)
at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189)
at org.xnio.ssl.JsseConnectedSslStreamChannel.handleReadable(JsseConnectedSslStreamChannel.java:180)
at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
at org.xnio.nio.NioHandle.run(NioHandle.java:90)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:184)
at ...asynchronous invocation...(Unknown Source)
at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:270)
at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:251)
at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:349)
at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:333)
at org.jboss.remotingjmx.RemotingConnector.connect(RemotingConnector.java:146)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
Java Code
--------------
JMXConnector jmxConnector= null;
String host = <remote server bind address>;
String port = <remote server bind port>;
String urlString = System.getProperty("jmx.service.url","service:jmx:remoting-jmx://" +
host + ":" + port);
try {
JMXServiceURL serviceURL = new JMXServiceURL(urlString);
HashMap<String, String[]> env = new HashMap<String, String[]>();
String[] creds = new String[2];
creds[0] = "myusername in mgmt-user.properties file";
creds[1] = "my password in mgmt-user.properties file";
env.put(JMXConnector.CREDENTIALS, creds);
jmxConnector = JMXConnectorFactory.connect(serviceURL, env);
jmxConnector.connect();
MBeanServerConnection connection = jmxConnector.getMBeanServerConnection();
System.out.println(" Successfully Got Connection "+connection.getMBeanCount());
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
-
21. Re: JMX remote monitoring in AS7
ejroberts Jun 29, 2012 9:42 AM (in response to smswamy)Hi
Do you have all of the requisite dependencies on your client classpath ?
I believe the jboss-client.jar residing in the bin/client directory of the jboss distribution holds all the classes that you need.
HTH
Ed
-
22. Re: JMX remote monitoring in AS7
smswamy Jun 29, 2012 10:05 AM (in response to ejroberts)Hi, Yes I have those things..I found the bug.
this line is the bug jmxConnector.connect();
it overridden this line jmxConnector = JMXConnectorFactory.connect(serviceURL, env);
Thanks for your time.