-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

All,

On 3/19/14, 12:24 PM, Christopher Schultz wrote:
> 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.

Setting the log level to ALL shows no attempt to even locate my
mbeans-descriptors.xml file. Any pointers for where I can start looking?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTKveiAAoJEBzwKT+lPKRYd+MQAJ/9UfsMatOnKlvsuJV+M4Cb
nJdYj9o7Na7GLjsP1nYTaCv95vqj+IlFhsCGZ4GH4VCp4ffBPBRD7kijcn+VUORn
pzfzbDP4qYLzM03SqTDNsx0Xk3mafd7ZppXqm+tYYy6h5IJNq+v+nN3K9SAThYhb
OcD7FWAeCc0CdBQT57VQesRQggMzCg+bVmFNBLC8dEwQ7BWx1Lh9PNybASQN7jjG
26KmmpGExOnj7pVHlBCS9bkuEuUOR1R2B4lsKTLNniaPW9AznKNdgziPxa7FhXCr
FWauW/yb0LmRFvSnHDhN+zTzHwcOK/qnKTf2dR3J2alsBPJs37e93q0jo+o/f4+q
rurDaSsYCkVckhhaGW4kiijMiXgdp2o6F0mMpId3AwGa/jqbQdfo8KqoQLz1Wcuq
D86fGX/WJdwwuZorkAvCBCP1ttU7xhFwbzBVE8VDHf+nDiA4Ggp1KBFQ3o7PRYWu
QD/7jqOiVNkiTBZomWIlgn5J2K8M8wgNlw1nRiSmLc64WFDRFGFNN3y4Va9qwX0F
6lIqtF01/X5iI2i4LsjKrfWK40OuVuqMyze5wJziLj6x5FTnjiAHie5afUQn3Jwb
o+W+5L9qL5WKQMEHS+yO/O/u/8McFg9JTDXE7hHOlGNJQM2AMmUWp5k+toxPCewL
9CJt+D/n+N2LPkJ/cege
=H4+B
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to