users@grizzly.java.net

Re: Enable JMX for HTTP Grizzly fails

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Date: Thu, 14 Oct 2010 15:50:29 +0200

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
>