2014-03-19 20:24 GMT+04:00 Christopher Schultz <ch...@christopherschultz.net>:
>
> I'm trying to write my own MBean, and I have it working: the bean is
> registered and I can browse it using jconsole, etc., call methods, etc.
>
> At one point during the process, I believe I had the
> beans-descriptors.xml file actually being loaded, so that my
> customized descriptions of attributes and methods were being shown in
> jconsole.
>
> At some point, I changed something and they are no longer showing up.
> It looks like I'm getting an introspected MBean description instead of
> the declared one I want. All the attributes for example are described
> as "Attribute exposed for management".
>
> I've set org.apache.tomcat.util.modeler.level=ALL and the same for the
> Console logger, so I'm getting a steady stream of output from the
> modeler package, including a whole bunch of messages like this:
>
> FINER [main] org.apache.tomcat.util.modeler.Registry.loadDescriptors
> Finding descriptor org/apache/catalina/authenticator
>
> Great. What I don't see is a similar message for my own MBean. It
> doesn't look like Tomcat is ever trying to load the
> mbeans-descriptors.xml file for my MBean.
>
> Here's what I've got:
>
> 0. Tomcat 8.0-trunk
> 1. A JAR file in CATALINA_BASE/lib containing my MBean interface,
> class, and mbeans-descriptors.xml, all in the same package
> (imaginatively called "mbeans"), and a Filter class that creates the
> bean and registers it with the MBean server.
> 2. The Tomcat "examples" webapp, with modifications to WEB-INF/web.xml
> to load the aforementioned Filter.
>
> Here's the whole mbeans-descriptors.xml file:
>
> <....>
>

1. Does your web application start, at all? Does you filter start?

2. How exactly are you registering your MBean?

Are you using Modeler API for that? (Registry.registerComponent(....))

3. Maybe run with a debugger?

> <?xml version="1.0"?>
>
> <mbeans-descriptors>
>   <mbean name="RequestStats"
>          className="org.apache.catalina.mbeans.ClassNameMBean"
>          description="Server statistics and configuration"
>          domain="Catalina"
>          type="mbeans.RequestStats">

4. I see that many <mbean>s have a "group" attribute. Yours does not have one.

(Actually it seems that this attribute is optional and is ignored.
There are no calls to ManagedBean.getGroup() except in
ManagedBean.toString()).

5. I hope that you do not have the second copy of your jar inside of
your webapp. So that it shadows the one in the lib/ directory.

6. Apparently many mbean descriptors are pre-loaded when Tomcat starts
- in o.a.c.mbeans.MBeanUtils.createRegistry()

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to