users@grizzly.java.net

Enable JMX for HTTP Grizzly fails

From: diyfiesta <toby.weston_at_gmail.com>
Date: Wed, 13 Oct 2010 22:35:04 -0700 (PDT)

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.