JBoss Fuse JMX not working

805 views Asked by At

I tried to connect JMX rmi url in Jboss fuse container for monitoring the queues. The URL not connected in jconsole,

service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi/camel

I want to implement in my bundle, How to connect MBean server in JBoss Fuse?

Advance Thanks.

2

There are 2 answers

0
Sridhar On BEST ANSWER

Finally solved the issue with the karaf username and password, Check with the username and password in users.properties file.

 service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-root

It should work.

JMXServiceURL url = new JMXServiceURL(serviceURL);
     HashMap<String, String[]> environment = new HashMap<String, String[]>();
         String username = "admin";
         String password = "admin";
         String[] credentials = new String[] { username, password };
         environment.put("jmx.remote.credentials", credentials);

      connectorServer = JMXConnectorFactory.connect(url,environment);
0
Alexey Yakunin On

IMHO just wrong URL.

You can see the current settings of your server in the org.apache.karaf.management.cfg.

For example:

#
# Port number for RMI registry connection
#
rmiRegistryPort = 1099

#
# Host for RMI registry
#
rmiRegistryHost = 0.0.0.0

#
# Port number for RMI server connection
#
rmiServerPort = 44444

#
# Host for RMI server
#
rmiServerHost = 0.0.0.0

#
# Name of the JAAS realm used for authentication
#
jmxRealm = karaf

#
# The service URL for the JMXConnectorServer
#
serviceUrl = service:jmx:rmi://${rmiServerHost}:${rmiServerPort}/jndi/rmi://${rmiRegistryHost}:${rmiRegistryPort}/karaf-${karaf.name}

#
# Whether any threads started for the JMXConnectorServer should be started as daemon threads
#
daemon = true

#
# Whether the JMXConnectorServer should be started in a separate thread
#
threaded = true

#
# The ObjectName used to register the JMXConnectorServer
#
objectName = connector:name=rmi

In my case URL looks like service:jmx:rmi://0.0.0.0:44444/jndi/rmi://0.0.0.0:1099/karaf-root

P.S. And don't forget to specify a user name and password.