0

I am running activemq-5.9 on Ubuntu 12.04 and it would be fair to say that I am new to active MQ.

I suspect that I am queueing records and not de-queueing them, so I am looking into using JMX to connect to my active MQ broker and see what's going on. Jconsole fails.

This is hard because most of the docs on how to do this is old, but I finally get down to running activemq list. When I do, it throws a rather lengthy stacktrace:

Connecting to JMX URL: service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
ERROR: java.lang.RuntimeException: Failed to execute list task. Reason: 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]
...
Caused by: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: 
    java.net.ConnectException: Connection refused
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:342)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:118)
    ... 21 more
Caused by: java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:589)
    at java.net.Socket.connect(Socket.java:538)
    at java.net.Socket.<init>(Socket.java:434)
    at java.net.Socket.<init>(Socket.java:211)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:148)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
    ... 26 more

Is there still something I have configured wrong? I have no firewall rules. I can't think what else to look for.

Abhijit Sarkar
  • 21,927
  • 20
  • 110
  • 219
Thom
  • 14,013
  • 25
  • 105
  • 185

2 Answers2

2

There is no 'failure to retrieve RMI server stub' here. There is a failure to connect to the RMI registry. Either it isn't running at all or you're looking in the wrong host, or port.

user207421
  • 305,947
  • 44
  • 307
  • 483
  • Uh, if you look at the error message, that's what it says. I am connecting to localhost, which is hard to screw up and it's the out of the box port. – Thom Apr 15 '14 at 12:21
  • It doesn't matter. There is no RMI Registry there to connect to. There is nothing listening at localhost:1099 at all. It's a TCP error at bottom. The ultimate goal is retrieval of the stub, but it's failing way before that. – user207421 Apr 15 '14 at 12:40
  • OK. So what do I do? netstat -l confirms nothing listening. – Thom Apr 15 '14 at 12:46
  • Start the RMI Registry. – user207421 Apr 18 '14 at 15:25
0

Make sure your RMI registry is running. You can do this with rmiregistry in another terminal, providing it's in the same working directory.

BenjaminJC
  • 307
  • 1
  • 3
  • 9