-
1. Re: service:jmx:rmi:///jndi/rmi://localhost:1090/jmxrmi AS7 Not working
dlofthouse Feb 23, 2012 6:14 AM (in response to aslamcl)If you are trying to access JMX please see the following: -
https://community.jboss.org/wiki/UsingJconsoleToConnectToJMXOnAS7
-
2. Re: service:jmx:rmi:///jndi/rmi://localhost:1090/jmxrmi AS7 Not working
aslamcl Feb 23, 2012 6:21 AM (in response to aslamcl)Exception in thread "main" java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused: connect]
at javax.management.remote.rmi.RMIConnector.connect(Unknown Source)
at javax.management.remote.JMXConnectorFactory.connect(Unknown Source)
at com.pcs.system.jboss.jms.JMXExample.main(JMXExample.java:19)
Caused by: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused: connect]
at com.sun.jndi.rmi.registry.RegistryContext.lookup(Unknown Source)
at com.sun.jndi.toolkit.url.GenericURLContext.lookup(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(Unknown Source)
at javax.management.remote.rmi.RMIConnector.findRMIServer(Unknown Source)
This is the exception I get.
-
3. Re: service:jmx:rmi:///jndi/rmi://localhost:1090/jmxrmi AS7 Not working
dlofthouse Feb 23, 2012 6:26 AM (in response to aslamcl)Yes you get the exception because you need to switch to Remoting instead of RMI for the calls.
-
4. Re: service:jmx:rmi:///jndi/rmi://localhost:1090/jmxrmi AS7 Not working
aslamcl Feb 24, 2012 5:37 AM (in response to dlofthouse)Darren, what do you meant by that?
I got following piece from https://docs.jboss.org/author/display/AS71/JMX+subsystem+configuration.
public
static
void
main(String[] args)
throws
Exception {
//Get a connection to the JBoss AS MBean server on localhost
String host =
"localhost"
;
int
port =
9999
;
// management-native port
String urlString =
System.getProperty(
"jmx.service.url"
,
"service:jmx:remoting-jmx://"
+ host +
":"
+ port);
JMXServiceURL serviceURL =
new
JMXServiceURL(urlString);
JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceURL,
null
);
MBeanServerConnection connection = jmxConnector.getMBeanServerConnection();
//Invoke on the JBoss AS MBean server
int
count = connection.getMBeanCount();
System.out.println(count);
jmxConnector.close();
}
I get the following exception when I run above piece of code.
Exception in thread "main" java.net.MalformedURLException: Unsupported protocol: remoting-jmx
at javax.management.remote.JMXConnectorFactory.newJMXConnector(Unknown Source)
at javax.management.remote.JMXConnectorFactory.connect(Unknown Source)
at com.pcs.obix.JMXExample.main(JMXExample.java:19)
So what could be the issue?
-
5. Re: service:jmx:rmi:///jndi/rmi://localhost:1090/jmxrmi AS7 Not working
dlofthouse Feb 24, 2012 6:48 AM (in response to aslamcl)To get the current error you probably don't have your classpath set correctly - can you show me what you currently have on the classpath?
-
6. Re: service:jmx:rmi:///jndi/rmi://localhost:1090/jmxrmi AS7 Not working
smarlow Feb 24, 2012 8:51 AM (in response to aslamcl)https://docs.jboss.org/author/display/AS71/JMX+subsystem+configuration is now updated to show setting the classpath to the AS7 jars.
-
7. Re: service:jmx:rmi:///jndi/rmi://localhost:1090/jmxrmi AS7 Not working
aslamcl Feb 26, 2012 11:22 PM (in response to dlofthouse)Thanks darran.. I have added jboss-client-7.1.0.Final.jar, and it works fine. Thanks alot
-
8. Re: service:jmx:rmi:///jndi/rmi://localhost:1090/jmxrmi AS7 Not working
jamesviet Jul 31, 2013 6:20 AM (in response to aslamcl)I have 1 question:
What version of JBoss 7 supported RMI?
Thanks,
-
9. Re: service:jmx:rmi:///jndi/rmi://localhost:1090/jmxrmi AS7 Not working
vishal.shinde Apr 7, 2014 3:46 AM (in response to aslamcl)Hi Aslam,
Can you please help me what you did exactly like in which file you added what to run it
Thanks,
Vishal