Apache camel JBoss保险丝JMX不工作

Apache camel JBoss保险丝JMX不工作,apache-camel,activemq,jmx,osgi-bundle,jbossfuse,Apache Camel,Activemq,Jmx,Osgi Bundle,Jbossfuse,我尝试连接Jboss fuse容器中的JMXRMI url以监视队列。 未在jconsole中连接的URL service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi/camel 我想在我的包中实现,如何在JBoss Fuse中连接MBean服务器 提前谢谢。我的网址不对 您可以在org.apache.karaf.management.cfg中查看服务器的当前设置 例如: # # Port number for RMI registry connec

我尝试连接Jboss fuse容器中的JMXRMI url以监视队列。 未在jconsole中连接的URL

service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi/camel
我想在我的包中实现,如何在JBoss Fuse中连接MBean服务器

提前谢谢。

我的网址不对

您可以在
org.apache.karaf.management.cfg
中查看服务器的当前设置

例如:

#
# 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
在我的例子中,URL看起来像
service:jmx:rmi://0.0.0.0:44444/jndi/rmi://0.0.0.0:1099/karaf-根目录

另外,别忘了指定用户名和密码。

IMHO只是错误的URL

您可以在
org.apache.karaf.management.cfg
中查看服务器的当前设置

例如:

#
# 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
在我的例子中,URL看起来像
service:jmx:rmi://0.0.0.0:44444/jndi/rmi://0.0.0.0:1099/karaf-根目录


另外,别忘了指定用户名和密码。

最终解决了karaf用户名和密码的问题, 检查users.properties文件中的用户名和密码

 service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-root
它应该会起作用

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);
JMXServiceURL=newjmxserviceurl(serviceURL);
HashMap环境=新建HashMap();
字符串username=“admin”;
字符串password=“admin”;
字符串[]凭据=新字符串[]{username,password};
put(“jmx.remote.credentials”,凭证);
connectorServer=JMXConnectorFactory.connect(url,环境);

最终解决了karaf用户名和密码的问题, 检查users.properties文件中的用户名和密码

 service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-root
它应该会起作用

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);
JMXServiceURL=newjmxserviceurl(serviceURL);
HashMap环境=新建HashMap();
字符串username=“admin”;
字符串password=“admin”;
字符串[]凭据=新字符串[]{username,password};
put(“jmx.remote.credentials”,凭证);
connectorServer=JMXConnectorFactory.connect(url,环境);