Okay using approach of first article. The MBean server is correctly
initialized and everything on the server side looks good.
Now we come to the client side. The first article assumes you are just
going to connect using a tool such as MC4J or JManage (monitoring tools).
That is not my use case. I want to write a command-line client that can
talk to the MBean (which is inside of Tomcat) and invoke an operation on
the MBean.
I use the Client.java sample from the Sun tutorial as a starting point.
I am able to connect to the server, and get a list of MBeans, but I fail
when trying to call createMBean(). I am using the simple two-parameter
version of createMBean() and it always fails with
javax.management.ReflectionException: The MBean class could not be
loaded by the default loader repository
It seems pretty clear that my client needs to use one of the other
versions of createMBean(), one that specifies some other Class Loader
but I have no clue what I should be using for that.
H. Hall wrote:
Steve Cohen wrote:
Let me ask my question a little more directly:
Does the presence of a descriptor cause instantiation of an instance
of an MBean
or do I have to write code to create a server-side instance of my
MBean and if so, where should this code reside
or is there some configuration artifact that causes this
instantiation to happen?
Why don't you take a look at these two articles:
http://today.java.net/pub/a/today/2005/11/15/using-jmx-to-manage-web-applications.html?page=1
http://marxsoftware.blogspot.com/2008/07/jmx-model-mbeans-with-apache-commons.html
If you use the NetBeans IDE you might be interested in the JMX plugin
for NB. Here is a link to a tutorial "Getting Started with JMX
Monitoring in NetBeans IDE 6.0"
http://www.netbeans.org/kb/60/java/jmx-getstart.html
cheers,
HH
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]