Results 1 to 4 of 4

Thread: Not able to get tutorial to work

  1. #1

    Default 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:

    Code:
    <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:

    Code:
    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. #2
    Join Date
    Dec 2005
    Location
    http://www.smartkey.co.uk
    Posts
    34

    Default

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

    http://www.smartkey.co.uk/blogArticl...ticleNumber=87

  3. #3
    Join Date
    Dec 2005
    Location
    http://www.smartkey.co.uk
    Posts
    34

    Default

    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. #4

    Default

    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: http://weblogs.java.net/blog/emcmanu..._informat.html.

    Thank you again.
    Last edited by laura; Dec 8th, 2008 at 02:31 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
  •