Announcement Announcement Module
No announcement yet.
Not able to get tutorial to work Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Not able to get tutorial to work

    I've tried pretty much everything so far, but haven't been able to get jmx working with spring. I'm building a webapp which will run in a Tomcat environment and Java 1.6.

    Basically (now) I've got:

    <context:mbean-export />
    <bean id="jmxControl" class="com.[].jmx.AdServerManagement" />
    The class to be exposed is annotated with @ManagedResource and the operations with @ManagedOperation. I've tried all the other ways of defining the xml file from the spring chapter on jmx

    Everything works fine when taken to a separate project (non-Tomcat). The class does instantiates in the Tomcat project too, but the export to the MBean server does not seem to happen.

    I can get this to work via the classic method:

    mbs = ManagementFactory.getPlatformMBeanServer();
    ObjectName clientName  = new ObjectName("Adserver:name=adserver");
    mbs.registerMBean(mbean, clientName);
    but I'd like to be able to use the spring annotations.

    Any ideas?

  • #2
    Here's an example of how you can use JMX and Spring in Tomcat:


    • #3
      There's another tutorial on how to do this here:

      &#104;&#116;&#116;&#112;&#58;&#47;&#47;&#119;&#119 ;&#119;.&#115;&#109;&#97;&#114;&#116;&#107;&#101;& #121;.&#99;&#111;.&#117;&#107;&#47;/blogArticle.html?articleNumber=87

      It's really simple to do - just follow the key steps. It worked for me


      • #4
        Thanks for the tutorial, but it seems to be very similar to the spring chapter on jmx, which was not useful for me. I ended up writing my own annotations,using this tutorial:

        Thank you again.
        Last edited by laura; Dec 8th, 2008, 02:31 PM.