JBoss Community

Re: Remote JMX connector for AS7

created by Thomas Diesler in JBoss AS7 Development - View the full discussion

We are still having a hard time to get this to work, which is a prerequisite for all remote OSGi testing (e.g. our Arquillian Hudson integration)

 

I modifid the JMXConnectorService such that it is more explicit in the URL and also setup a test case that checks the JSR160 connection

 

http://github.com/jbosgi/jboss-as/commit/78dc6049fd64389ff2e1a9a50e78e6edb213a0ea

 

[tdiesler@tdvaio jmx]$ mvn -Dtest=JMXConnectorTestCase test

 

Running org.jboss.as.jmx.JMXConnectorTestCase
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.278 sec

 

The above sets up the JMXConnectorServer in @BeforeClass and checks whether the MBeanServer can be obtained through the connection.

 

However, in the remote schenario with AS running I get

 

[tdiesler@tdvaio jmx]$ mvn -Djmx.remote=true -Dtest=JMXConnectorTestCase test

 

java.rmi.ConnectException: Connection refused to host: 192.168.0.101; nested exception is:
     java.net.ConnectException: Connection refused
     at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
     at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
     at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
     at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
     at sun.rmi.registry.RegistryImpl_Stub.list(Unknown Source)

     at org.jboss.as.jmx.JMXConnectorTestCase.beforeClass(JMXConnectorTestCase.java:71)

 

The issue seems to be that remote access of the RMI registry fails already.

 

            // Check if the RMI registry is running. With AS started this should succeed.
            Registry registry = LocateRegistry.getRegistry(host.getHostAddress(), rmiPort);
            String[] objectNames = registry.list();
            assertNotNull("Registered RMI objects", objectNames);

 

Any idea, why a remote client cannot access the registry that AS exports?

Reply to this message by going to Community

Start a new discussion in JBoss AS7 Development at Community