Tomcat 5.0 and custom MBeans
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   P_R
Posted On:   Thursday, March 4, 2004 01:47 PM

I would like to know how to configure a custom mbean in tomcat 5.0. Following are the bean definitions and the descriptor and here are the things that I tried without any luck. 1. Copied the HelloMBean and the Hello class to the Tomcat/common/classes directory. 2. Modified server.xml to point to the xml file. 3. When I bring up Tomcat, it reports the following error: MBean descriptors not found:/com/test/mbeans/mbeans-descriptors.xml I would appreciate it if anyone could point out what I am doing wrong. Also, once Tomcat finds and instantiates this HelloMBean, how do I get a handle to the MBean from my application code? Do I   More>>

I would like to know how to configure a custom mbean in tomcat 5.0. Following are the bean definitions and the descriptor and here are the things that I tried without any luck.


1. Copied the HelloMBean and the Hello class to the Tomcat/common/classes directory.


2. Modified server.xml to point to the xml file.






3. When I bring up Tomcat, it reports the following error:


MBean descriptors not found:/com/test/mbeans/mbeans-descriptors.xml


I would appreciate it if anyone could point out what I am doing wrong. Also, once Tomcat finds and instantiates this HelloMBean, how do I get a handle to the MBean from my application code? Do I have to do a JNDI lookup and if so, how do I do it?


Thanks.


HelloMBean.java

----------------

			
package com.test.mbeans;

public interface HelloMBean {

// management attributes
public String getName();
public void setName(String name);

// management operations
public void print();

}




Hello.java

-----------

			
package com.test.mbeans;


public class Hello implements HelloMBean {

private String name = "";

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public void print() {
System.out.println("Hello, " + name + "!!" );
}
}




mbeans-descriptors.xml

-----------------------

			
<?xml version="1.0" ?>



mbean" domain="Catalina" group="Hello" type="javax.management.StandardMBean">








   <<Less

Re: Tomcat 5.0 and custom MBeans

Posted By:   Vincent_Ngu  
Posted On:   Thursday, March 4, 2004 02:52 PM

Just installed Tomcat5. How I configure it to have JSP to work?
About | Sitemap | Contact