1 Reply Latest reply on Oct 9, 2012 6:26 AM by dlofthouse

    Remote JMX call fails with status "WAITING"

    thebravedave

      Hello, I am attempting to make a remote JMX call to an mbean on my server.

       

      The client side code I am attempting to make the call from is a grails project. I have jboss-client.jar compiled in with the grails project.

       

      When I try and make the remote JMX mbean call, I get this error

       

      2012-10-08 15:08:20,207 ERROR [StackTrace] Full Stack Trace:: java.lang.RuntimeException: Operation failed with status WAITING

              at org.jboss.remotingjmx.RemotingConnector.connect(RemotingConnector.java:154)

              at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)

              at net.sococo.serverconfig.SococoXmlController$_closure1.doCall(SococoXmlController.groovy:41)

              at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)

              at java.lang.Thread.run(Thread.java:662)

       

       

      Here is my client call

       

              serverEnvironment = "myserver.serverofmine.net"

       

              String serverURL = "service:jmx:remoting-jmx://" + serverEnvironment + ":9999"         

              String username = "david"

              String password = "davidpass"

              HashMap env = new HashMap()

       

              JMXServiceURL url = new JMXServiceURL(serverURL)

              if(username != null && password != null) {

                  String[] creds = new String[2]

                  creds[0] = username

                  creds[1] = password

                  env.put(JMXConnector.CREDENTIALS, creds)

              }

       

              JMXConnector jmxc = JMXConnectorFactory.connect(url, env)

              MBeanServerConnection server = jmxc.getMBeanServerConnection()

       

              ObjectName oName = new ObjectName("net.mysever:name=net.myserver.myserver.xml.XmlBean")

              String master = "master"

              Object[] objArray = new Object[1]

              objArray[0] = master

              String[] strArray = new String[1]

              strArray[0] = "java.lang.String"

              Object ret;

       

              ret = server.invoke(oName, "xmlDeploy", objArray, strArray)

       

              String returnedString = ret.toString();

      ------------------------------

       

      In my standalone.xml I have

       

      <security-realm name="ApplicationRealm">

                      <authentication>

                          <properties path="application-users.properties" relative-to="jboss.server.config.dir"/>

                      </authentication>

      </security-realm>

      ...

      <subsystem xmlns="urn:jboss:domain:jmx:1.1">

                  <show-model value="true"/>

                  <remoting-connector/>

      </subsystem>

      ....

      <subsystem xmlns="urn:jboss:domain:remoting:1.1">

                  <connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/>

                  <outbound-connections>

                      <remote-outbound-connection name="areaserver-remote-ejb-connection" outbound-socket-binding-ref="areaserver-remote-ejb">

                          <properties>

                              <property name="SASL_POLICY_NOANONYMOUS" value="false"/>

                              <property name="SSL_ENABLED" value="false"/>

                          </properties>

                      </remote-outbound-connection>

                  </outbound-connections>

      </subsystem>

       

      -------------------

       

      my username and password I am using have been added to the application-users.properties from the  add-user.sh  script.

       

       

       

      Does anyone know what I might be doing wrong?

       

      Please help.

       

      David

        • 1. Re: Remote JMX call fails with status "WAITING"
          dlofthouse

          It sounds you like you could possibly have a bug as it should not hang although there have been some updates in this area so I would suggest checking the latest nightly build and if it still hangs then raise a Jira.

           

          However in your configuration you have the JMX access exposed over the management interface so port 9999 - that part of your config and client is correct but this means the user you need to connect as will need to be a management user and not an application user.