2 Replies Latest reply on Mar 15, 2012 9:18 AM by aslamcl

    Remote MBeanServerConnection from WAR failed- jboss-as-7.1.0.Final

    aslamcl

      Hi,

       

      I am not able to connect to active mq from jboss-as-7.1.0.Final using jmx from my war, but it is working fine Jboss 5.1

      Following is the piece of the code which I use to connect.

       

       

      Map<String, String[]> env = new HashMap<String, String[]>();

      String[] credentials = new String[] { "", "" };

      env.put(JMXConnector.CREDENTIALS, credentials);

      try {

          JMXConnector connector = JMXConnectorFactory.newJMXConnector(new JMXServiceURL("service:jmx:rmi:///jndi/rmi://192.168.220.130:1400/jmxrmi), env);

          connector.connect();

          MBeanServerConnection mBeanServerConnection = connector.getMBeanServerConnection();

      } catch (Exception e) {

          e.printStackTrace();

      }

       

       

      Caused by: javax.naming.NameNotFoundException: rmi://192.168.210.109:1400/jmxrmi -- service jboss.naming.context.java.rmi:."192.168.220.130:1400".jmxrmi

          at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)

          at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:177)

          at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:113)

          at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:213)

          at javax.naming.InitialContext.lookup(Unknown Source)

          at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(Unknown Source)

          at javax.management.remote.rmi.RMIConnector.findRMIServer(Unknown Source)

          ... 47 more

       

      Pleae help.