Results 1 to 4 of 4

Thread: How can I browse mbeans exported by spring in a console app

  1. #1
    Join Date
    Aug 2004
    Posts
    15

    Default How can I browse mbeans exported by spring in a console app

    I have add mbeanserver to my app like this

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

    <bean id="exporter" class="org.springframework.jmx.export.MBeanExporte r">
    <property name="beans">
    <map>
    <entry key="bean:name=hellor1" value-ref="hellor1"/>
    <entry key="bean:name=httpConnector">
    <ref local="httpConnector"/>
    </entry>
    </map>
    </property>
    <property name="server" ref="mbeanServer"/>
    </bean>

    and I have added -Dcom.sun.management.jmxremote to the jvm parameters
    when the app starts, spring framework's log claims that the server has been created and the mbeans have been created.
    when I connect to the app through Jconsole. It connected successfully but none of spring created mbean is show. Only jdk's mbeans are there.
    On the other hand, if I use Jconsole to connect to a tomcat server which has spring web apps deployed, Jconsole does show all the mbeans. :shock:
    What is wrong?Plean help me

  2. #2
    Join Date
    Oct 2005
    Posts
    29

    Default

    Hi, I have worked it out.
    Simply change the mbeanserver configuration to
    <bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServer FactoryBean">
    <property name="locateExistingServerIfPossible" value="true"/>
    </bean>
    and it works.
    I belive -Dcom.sun.management.jmxremote tell jvm to create its own mbeanserver, it is this server which Jconsole connected to.
    And we need "hook" spring's mbeanserver to jvm's
    locateExistingServerIfPossible can do this.

  3. #3
    Join Date
    Aug 2004
    Posts
    15

    Default help..

    Hi, I have worked it out.
    I do not know how to stop this.

  4. #4
    Join Date
    Oct 2005
    Posts
    29

    Default Re: help..

    Quote Originally Posted by Anonymous
    Hi, I have worked it out.
    I do not know how to stop this.
    don't know what you mean. But if you mean my English is poor... Yes.

Similar Threads

  1. Spring MVC Web Framework versus Struts
    By biguniverse in forum Web Flow
    Replies: 27
    Last Post: Aug 29th, 2012, 03:57 AM
  2. Replies: 5
    Last Post: Aug 9th, 2008, 05:30 AM
  3. Comparision JMX Spring
    By umeshs79 in forum Container
    Replies: 5
    Last Post: Jun 16th, 2005, 12:27 PM
  4. A Spring Class Loader?
    By azzoti in forum Architecture
    Replies: 8
    Last Post: May 7th, 2005, 04:02 AM
  5. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •