-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
All,
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:
<?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">
<attribute name="className"
description="Fully qualified class name of the managed
object"
type="java.lang.String"
writeable="false"/>
<operation name="getProcessingTime"
description="Gets the total number of milliseconds
spent processing requests."
impact="INFO"
returnType="long">
</operation>
<operation name="getRequestCount"
description="Gets the total number of requests processed."
impact="INFO"
returnType="long">
</operation>
<operation name="resetCounters"
description="Resets all counters."
impact="ACTION"
returnType="void">
</operation>
</mbean>
</mbeans-descriptors>
I realize that two of the "operations" should probably be "attributes"
instead, but it was about the time I changed from "operation" to
"attribute" that things stopped working, so I rolled-back my changes a
bit to back-track.
Here's the contents of my mbean-example.jar file:
Archive: mbeans-example.jar
Length Method Size Ratio Date Time CRC-32 Name
- -------- ------ ------- ----- ---- ---- ------ ----
0 Stored 0 0% 03-19-14 12:19 00000000 META-INF/
103 Defl:N 90 13% 03-19-14 12:19 d2b59077
META-INF/MANIFEST.MF
0 Stored 0 0% 03-19-14 11:57 00000000 filters/
0 Stored 0 0% 03-19-14 11:57 00000000 mbean/
2387 Defl:N 1196 50% 03-19-14 12:19 2d7e415d
filters/RequestStatsFilter.class
714 Defl:N 436 39% 03-19-14 11:57 7bdf9245
mbean/RequestStats.class
165 Defl:N 138 16% 03-19-14 11:57 041e1c7f
mbean/RequestStatsMBean.class
1058 Defl:N 390 63% 03-19-14 12:19 ba6ca9b6
mbean/mbeans-descriptors.xml
I can't see to find the text "mbean.Request" anywhere in the log
files. I've become desperate and set org.apache.tomcat.level=ALL and
org.apache.catalina.level=ALL to see if I can find anything.
Can anyone shed some light on why my mbeans-descriptors.xml file isn't
being loaded -- or even looked-for?
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBCAAGBQJTKcTAAAoJEBzwKT+lPKRYPCgP/RCphdm99mvtPCKnca7pDebU
rTY/9rg8GnUsvIaZk5n5AH4yDIp4rVQUtNHUdX7UniAgkMkMzj78djC2a4rlOGpg
c9n872banvQzPnOf5zEC0/WfKQsW/qD0JeO1+mROTVRuPO119n7K2p6YxZxTD870
0qN9IlE1qd5q0mOI7gqP0YS6qS77OaYUyb8IFfiyTyuKzuHJyz+SodR7RasRQH2y
ABUaKbyRzH1kj7WIOgBFVBiNfGUF9XPHhrqm+gEDGuX3+0oQRSay+B98mSw0FsEB
Sj9vjKtYfKMnT4amvC43Df2yqSN+qyeDx/nyGQVFif55XPbe/Zw0LztHBLjmlKiI
jl8EQPfzhrFO7V2tC1WZkjz2+bWDrz9YJJ18s6NSpb+zd8HCnDnRh3WvD1+3+yP5
fPV4IgH3D1MNhPuY6ek5v7Pl6LZ4914+h3zesYeZADURCtxaIatoBltnoCe0wuh7
Bh2qzOklYrlGpQW2DKjGmydJwjq+MdYVimzCs/ZuovULJLxFOTYRUsy5I2UYedGh
qZF4hDkrZUtmDUUk+fZt0K3yO4ARcwNzMRT0bCWC4ue9+yqDfX+cwBCuv84zdZlY
65WVKgW9xF7SaHh6mb63D2Mw1vgn6Y3350XoE8kABbfj84zcJzCr8BYdbtKO9GG8
32b0D79cvbvM1ki8NjRA
=1oNm
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]