users@grizzly.java.net

Re: Enable JMX for HTTP Grizzly fails

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Date: Fri, 15 Oct 2010 12:32:04 +0200

Hi Toby,

> That works fine. I did look at the apache modeller project but (mis)
> assumed
> I'd need a bunch of XML config to set it up. I also assumed that I
> could
> register the JMX component through the platform server which I now
> see I
> can't! Is this tied to the commons modeller project or is there a
> vanilla
> Java mechanism?
Looks like core Java mechanism requires Grizzly objects to follow JMX
compliance model (implement specific interfaces etc), which is not in
Grizzly.

> What version of the modeller project do you recommend? The 2.0.1
> version I'm
> using shows the getRegistry method as deprecated...
Frankly, I'm not following modeler changes, but will appreciate if
you'll be able to share what you'll find about this.

Thanks a lot.

WBR,
Alexey.

>
> Thanks again,
> Toby
>
>
> Oleksiy Stashok-2 wrote:
>>
>> Hi,
>>
>> can you pls. do the following:
>>
>> ws.enableJMX(new Management() {
>>
>> public void registerComponent(Object bean, ObjectName
>> oname, String type)
>> throws Exception{
>>
>> Registry.getRegistry().registerComponent(bean,oname,type);
>> }
>>
>> public void unregisterComponent(ObjectName oname) throws
>> Exception{
>> Registry.getRegistry().unregisterComponent(oname);
>> }
>> });
>>
>> with the Apache
>> org.apache.commons.modeler.Registry;
>>
>> Thanks.
>>
>> WBR,
>> Alexey.
>>
>>
>>
>>
>> On Oct 14, 2010, at 7:35 , diyfiesta wrote:
>>
>>>
>>> with...
>>>
>>> javax.management.NotCompliantMBeanException: MBean class
>>> com.sun.grizzly.http.SelectorThread does not implement DynamicMBean,
>>> neither
>>> follows the Standard MBean conventions
>>> (javax.management.NotCompliantMBeanException: Class
>>> com.sun.grizzly.http.SelectorThread is not a JMX compliant Standard
>>> MBean)
>>> nor the MXBean conventions
>>> (javax.management.NotCompliantMBeanException:
>>> com.sun.grizzly.http.SelectorThread: Class
>>> com.sun.grizzly.http.SelectorThread is not a JMX compliant MXBean)
>>> at
>>> com
>>> .sun.jmx.mbeanserver.Introspector.checkCompliance(Introspector.java:
>>> 160)
>>> at
>>> com
>>> .sun
>>> .jmx
>>> .interceptor
>>> .DefaultMBeanServerInterceptor
>>> .registerMBean(DefaultMBeanServerInterceptor.java:305)
>>> at
>>> com
>>> .sun
>>> .jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:
>>> 482)
>>> at
>>> com
>>> .sun
>>> .grizzly
>>> .http.embed.GrizzlyWebServer.enableJMX(GrizzlyWebServer.java:
>>> 625)
>>>
>>> code looks like this....
>>>
>>> public Hello() {
>>> server.addGrizzlyAdapter(new GrizzlyAdapter() {
>>> @Override
>>> public void service(GrizzlyRequest request,
>>> GrizzlyResponse
>>> response) {
>>> try {
>>> response.getWriter().println(format("hello world
>>> (%s)",
>>> request.getMethod()));
>>> } catch (IOException e) {
>>> e.printStackTrace();
>>> }
>>> }
>>> }, new String[]{"/"});
>>> server.enableJMX(new Management() {
>>> public void registerComponent(Object bean, ObjectName
>>> objectName, String type) throws Exception {
>>>
>>> ManagementFactory.getPlatformMBeanServer().registerMBean(bean,
>>> objectName);
>>> }
>>>
>>> public void unregisterComponent(ObjectName objectName)
>>> throws
>>> Exception {
>>>
>>> ManagementFactory
>>> .getPlatformMBeanServer().unregisterMBean(objectName);
>>> }
>>> });
>>> }
>>>
>>> any tips?
>>>
>>> cheers
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Enable-JMX-for-HTTP-Grizzly-fails-tp29959367p29959367.html
>>> Sent from the Grizzly - Users mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>>> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/Enable-JMX-for-HTTP-Grizzly-fails-tp29959367p29966055.html
> Sent from the Grizzly - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>