0 Replies Latest reply on Aug 21, 2006 7:16 AM by geirgp

    JMX ServiceURL and Spring

    geirgp

      Okay, spring and JMX again. I'm using Spring's serverConnector to serve my MBean's via JMX. This is done my adding the following lines to Spring's config

      <bean id="serverConnector" class="org.springframework.jmx.support.ConnectorServerFactoryBean">
       <property name="serviceUrl" value="service:jmx:rmi://localhost:5544" />
       </bean>


      This works very well and I can access all beans in JBoss' MBean server remotely. However the last part of the serviceUrl used to connect to this server is random ("service:jmx:rmi://localhost:5544/stub/***random***"). The serviceUrl changes everytime I deploy the application, so I have to change my client-application as well.

      I've consulted the Spring forum which refered me to JBoss as Spring doesn't do anything but forward calls to the appropriate JMX implementation.

      So the big question is if there is a way to set this serviceUrl manually, a way to look it up or maybe traverse through a list of serviceUrls. Any way works for me as long as I don't have to look it up manually and copy it into my client application everytime I redeploy or restart JBoss.

      The serviceUrl looks like the following. For now i just use the JBoss JMX-console to look it up (serverConnector is registered as a MBean) and copy-paste into client application:
      service:jmx:rmi://localhost:5544/stub/rO0ABXNyAC5qYXZheC5tYW5hZ2VtZW50LnJlbW90ZS5ybWkuUk1JU2VydmVySW1wbF9TdHViAAAAAAAAAAICAAB4cgAaamF2YS5ybWkuc2VydmVyLlJlbW90ZVN0dWLp/tzJi+FlGgIAAHhyABxqYXZhLnJtaS5zZXJ2ZXIuUmVtb3RlT2JqZWN002G0kQxhMx4DAAB4cHc3AAtVbmljYXN0UmVmMgAADDE3Mi4yNS4xMS4yOAAAFagAAAAAAAAAArBYvPsAAAENINmEZYAAAHg=


      Any ideas? Thanks in advance.

      Geir