Announcement Announcement Module
Collapse
No announcement yet.
Problem with definition of JMX server Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with definition of JMX server

    I have encountered the following problem:

    I have these beans defined in my applicationContext.xml file

    <bean id="jmxExporter" class="org.springframework.jmx.export.annotation.A nnotationMBeanExporter" >
    <property name="server"><ref local="jmxServer"/></property>
    </bean>

    <bean id="jmxServer" class="org.springframework.jmx.support.MBeanServer FactoryBean" >
    </bean>

    When I try to access remotely my JMX-enabled beans via jconsole I do not see them in UI.

    I could see them only after I added <property name="locateExistingServerIfPossible" value="true" /> to definition of "jmxServer" bean.

    According to Spring tutorial this is not required if I have in "jmxExporter" bean the explicit reference to "jmxServer" bean.

    I use Java 5 and Spring 2.5.

    Can anybody comment on this issue ?

    Thank you.

  • #2
    Hi,

    Iam always using this configuration to expose beans. It works fine for me beacuse I am deployng on jboss.

    <bean id="exporter" class="org.springframework.jmx.export.MBeanExporte r" lazy-init="false">
    <property name="registrationBehaviorName" value="REGISTRATION_REPLACE_EXISTING" />
    <property name="assembler">
    <bean class="org.springframework.jmx.export.assembler.In terfaceBasedMBeanInfoAssembler">
    <property name="managedInterfaces" value="com.infosys.shop.admin.jmx.ClientService" />
    </bean>
    </property>
    <property name="beans">
    <util:map id="serviceBeans">
    <entry key="tds.shop:service=ClientService" value-ref="clientService" />
    </util:map>
    </property>

    </bean>

    If you don't use the AS try to add the following:
    <bean id="registry" class="org.springframework.remoting.rmi.RmiRegistr yFactoryBean">
    <property name="port" value="11099" />
    </bean>

    <bean class="org.springframework.jmx.support.ConnectorSe rverFactoryBean" depends-on="registry">
    <property name="serviceUrl" value="service:jmx:rmi://localhost/jndi/rmi://localhost:11099/jmxrmi" />
    </bean>

    br
    Vassil

    Comment

    Working...
    X