NotCompliantMBeanException: Class does not expose a manageme
moviolone Sep 24, 2008 9:25 AMHi All,
I'm trying to deploy a .sar containing an MBean on JBoss 4.2.3.GA, but I keep on getting the following exception:
2008-09-24 15:02:38,250 DEBUG [org.jboss.deployment.SARDeployer] create operation failed for package file:/D:/workspace/TestBench/JBossESB/jboss-4.2.3.GA/server/myserver/deploy/my_sar.sar org.jboss.deployment.DeploymentException: Class does not expose a management interface: java.lang.Object; - nested throwable: (javax.management.NotCompliantMBeanException: Class does not expose a management interface: java.lang.Object) at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:196) at org.jboss.system.ServiceController.install(ServiceController.java:226) at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source) ... Caused by: javax.management.NotCompliantMBeanException: Class does not expose a management interface: java.lang.Object at org.jboss.mx.metadata.MBeanCapability.of(MBeanCapability.java:102) at org.jboss.mx.metadata.MBeanCapability.of(MBeanCapability.java:100) at org.jboss.mx.metadata.MBeanCapability.of(MBeanCapability.java:100) at org.jboss.mx.metadata.MBeanCapability.of(MBeanCapability.java:100) at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:182) ... 33 more
This is my jboss-service.xml, that is placed in a META-INF folder inside the sar
<server> <mbean code="my.package.ServerInitializationService" name="my.package:service=ServerInitialization"/> </server>
And these are the MBean interface and class
package mypackage.interfaces; import org.jboss.system.ServiceMBean; public interface ServerInitializationServiceMBean extends ServiceMBean { public void init(); }
package my.package; import java.util.logging.Logger; import org.jboss.annotation.ejb.Management; import org.jboss.annotation.ejb.Service; import org.jboss.system.ServiceMBeanSupport; import my.package.interfaces.ServerInitializationServiceMBean; @Service(objectName = "my.package:service=ServerInitialization") @Management(ServerInitializationServiceMBean.class) public class ServerInitializationService extends ServiceMBeanSupport implements ServerInitializationServiceMBean { private static final String BEAN_NAME = "Server Initialization"; private final Logger LOGGER = Logger.getLogger(ServerInitializationService.class.getName()); public ServerInitializationService() { super(); } public void init() { ... } public void createService() { ... } public void destroyService() { ... } public String getName() { return BEAN_NAME; } public int getState() { // TODO Auto-generated method stub return 0; } public String getStateString() { // TODO Auto-generated method stub return null; } public void jbossInternalLifecycle(String arg0) throws Exception { // TODO Auto-generated method stub } public void startService() throws Exception { init(); } public void stopService() { // TODO Auto-generated method stub ... } }
I've searched the net and the JBoss wiki and doc, but couldn't find anything wrong with the code (see http://wiki.jboss.org/wiki/ExampleHelloWorldService)
Is there something I'm doing wrong?
Thanks for your help
Daniele