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

    JMX ServiceURL and Spring

    Geir Newbie

      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" />

      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:

      Any ideas? Thanks in advance.