Uploaded image for project: 'ActiveMQ'
  1. ActiveMQ
  2. AMQ-3943

Connect to ActiveMQ server's jmx feature,but failed.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: 5.7.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      SLES 11 sp1 x64,
      ActiveMQ 5.5.1,
      Java(TM) SE Runtime Environment (build 1.6.0_29-b11)

      Description

      Code follow.I connect to an ActiveMQ server's jmx feature.I confirm the jmx feature is enable,because the same code work well on orther blades.
      public static void main(String args[]) throws UnknownHostException, IOException
      {
      JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://128.128.17.1:2011/jmxrmi");
      String username = "guest";

      String password = "guest";

      Map env = new HashMap();
      String[] credentials = new String[]

      { username, password }

      ;
      env.put(JMXConnector.CREDENTIALS, credentials);
      JMXConnector connector = JMXConnectorFactory.connect(url, env);
      connector.connect();
      connector.close();
      }
      But in a blade,it throws exception :
      Exception in thread "main" java.rmi.ConnectException: Connection refused to host: 127.0.0.1; 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.invoke(UnicastRef.java:110)
      at javax.management.remote.rmi.RMIServerImpl_Stub.newClient(Unknown Source)
      at javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2327)
      at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:277)
      at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
      at SyntaxMain.main(SyntaxMain.java:24)
      Caused by: java.net.ConnectException: Connection refused
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
      at java.net.Socket.connect(Socket.java:529)
      at java.net.Socket.connect(Socket.java:478)
      at java.net.Socket.<init>(Socket.java:375)
      at java.net.Socket.<init>(Socket.java:189)
      at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
      at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
      at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
      ... 8 more
      In fact,I connect to the 128.128.17.1 ActiveMQ server's jmx feature,but it point me that refusing by 127.0.0.1.Have to say this make me blues.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              shamokuyuwpz shamokuyuwpz
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: