2016-12-19 18 views

答えて

0

は最後に、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); 
0

私見。

あなたはorg.apache.karaf.management.cfgでサーバーの現在の設定を見ることができます。例えば

:私の場合のURLは

# 
# 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 

service:jmx:rmi://0.0.0.0:44444/jndi/rmi://0.0.0.0:1099/karaf-root

P.S.のように見えますまた、ユーザー名とパスワードを指定することを忘れないでください。

関連する問題