Getting exported JMX beans to coexist with VM JMX
HI,
I have managed to get JMX up and running using spring support for a number of beans using the following code:
<!-- create rmi registry and export jmx beans to it -->
<bean id="registry"
class="org.springframework.remoting.rmi.RmiRegistr yFactoryBean">
<property name="port" value="1099" />
</bean>
<bean id="serverConnector"
class="org.springframework.jmx.support.ConnectorSe rverFactoryBean" destroy-method="destroy">
<property name="objectName" value="connector:name=rmi" />
<property name="serviceUrl" value="service:jmx:rmi://localhost/jndi/rmi://localhost:1099/djfeed" />
<property name="server" ref="mbeanServer"></property>
</bean>
I have also managed to get the VM exporting all information about itself on a different port using the args on startup as follows:
java -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.password.file=/blabla/jmxremote.password -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=1199 com.blabla.Application
My problem is that if I try and set the port of the vm to 1099 so all beans appear on the same port (application beans and vm beans) I get
java.rmi.AccessException: Cannot modify this registry
when the spring rmi registry starts up. I'm guessing this has something to do with authentication but can't see what I can set to fix this (or am I on the wrong path here???). One thing I did spot are the environment settings that can be passed into the connector server factory bean e.g.
<property name="environment">
<map>
<entry key="jmx.remote.authenticator" value-ref="???????" />
</map>
</property>
Any ideas!?