[jboss-user] [JMX] - Exception when deploying a XMBean

rsobchak do-not-reply at jboss.com
Fri Sep 25 16:58:39 EDT 2009


I have a standard MBean that deploys fine on JBossesb-server-4.6 (JDK 1.5). I used twiddle to create the XMBean XML from the MBean. I then changed the jboss-service.xml to

  | <?xml version='1.0' encoding='UTF-8' ?>
  | <!DOCTYPE server PUBLIC    
  |                      "-//JBoss//DTD MBean Service 3.2//EN"
  |                      "http://www.jboss.org/j2ee/dtd/jboss-service_3_2.dtd">
  | <server>
  | 
  | 	<!--  Specify required library jars as needed.  --> 
  | 	<classpath codebase="." archives="*" /> 
  | 
  | 	<!-- Mail Service -->
  | 	<mbean code="com.mail.MailService" 
  | 		   name="com.mail:service=MailService"
  | 		   xmbean-dd="mailservice-xmbean.xml">
  |         </mbean>
  | </server>
  | 

The mailservice-xmbean.xml looks like 

  | <?xml version="1.0" encoding="UTF-8"?>
  | <!DOCTYPE mbean PUBLIC
  |    "-//JBoss//DTD JBOSS XMBEAN 1.2//EN"
  |    "http://www.jboss.org/j2ee/dtd/jboss_xmbean_1_2.dtd">
  | <!--
  |    xmbean descriptor generated by 'twiddle'
  |    on Fri Sep 25 12:51:00 EDT 2009
  |    for 'com.mail:service=MailService'
  | -->
  | <mbean>
  |    <description>Management Bean.</description>
  |    <class>com.mail.MailService</class>
  | 
  |    <constructor>
  |       <description>MBean Constructor.</description>
  |       <name>com.mail.MailService</name>
  |    </constructor>
  | 
  | 	&defaultAttributes;
  | 	
  |    <attribute access='read-write' getMethod='getMailFromName' setMethod='setMailFromName'>
  |       <description>MBean Attribute.</description>
  |       <name>MailFromName</name>
  |       <type>java.lang.String</type>
  |    </attribute>
  |    <attribute access='read-write' getMethod='getMailFrom' setMethod='setMailFrom'>
  |       <description>MBean Attribute.</description>
  |       <name>MailFrom</name>
  |       <type>java.lang.String</type>
  |    </attribute>
  |    <attribute access='read-only' getMethod='getStateString'>
  |       <description>MBean Attribute.</description>
  |       <name>StateString</name>
  |       <type>java.lang.String</type>
  |    </attribute>
  |    <attribute access='read-only' getMethod='getState'>
  |       <description>MBean Attribute.</description>
  |       <name>State</name>
  |       <type>int</type>
  |    </attribute>
  |    <attribute access='read-write' getMethod='isEnabled' setMethod='setEnabled'>
  |       <description>MBean Attribute.</description>
  |       <name>Enabled</name>
  |       <type>boolean</type>
  |    </attribute>
  |    <attribute access='read-only' getMethod='getName'>
  |       <description>MBean Attribute.</description>
  |       <name>Name</name>
  |       <type>java.lang.String</type>
  |    </attribute>
  |    <attribute access='read-write' getMethod='getMailURL' setMethod='setMailURL'>
  |       <description>MBean Attribute.</description>
  |       <name>MailURL</name>
  |       <type>java.lang.String</type>
  |    </attribute>
  | 
  |    <operation>
  |       <description>MBean Operation.</description>
  |       <name>start</name>
  |       <return-type>void</return-type>
  |    </operation>
  |    <operation>
  |       <description>MBean Operation.</description>
  |       <name>jbossInternalLifecycle</name>
  |       <parameter>
  |          <description></description>
  |          <name>p1</name>
  |          <type>java.lang.String</type>
  |       </parameter>
  |       <return-type>void</return-type>
  |    </operation>
  |    <operation>
  |       <description>MBean Operation.</description>
  |       <name>destroy</name>
  |       <return-type>void</return-type>
  |    </operation>
  |    <operation>
  |       <description>MBean Operation.</description>
  |       <name>create</name>
  |       <return-type>void</return-type>
  |    </operation>
  |    <operation>
  |       <description>MBean Operation.</description>
  |       <name>sendTestMessage</name>
  |       <return-type>void</return-type>
  |    </operation>
  |    <operation>
  |       <description>MBean Operation.</description>
  |       <name>stop</name>
  |       <return-type>void</return-type>
  |    </operation>
  |    <operation>
  |       <description>MBean Operation.</description>
  |       <name>sendTestMessage</name>
  |       <parameter>
  |          <description></description>
  |          <name>p1</name>
  |          <type>java.lang.String</type>
  |       </parameter>
  |       <return-type>void</return-type>
  |    </operation>
  | 
  | 	&defaultOperations;   		
  | 	
  | </mbean>
  | 

During deployment the following exception is thrown

  | 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)
  | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | 	at java.lang.reflect.Method.invoke(Method.java:585)
  | 	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
  | 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  | 	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
  | 	at $Proxy4.install(Unknown Source)
  | 	at org.jboss.deployment.SARDeployer.create(SARDeployer.java:251)
  | 	at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
  | 	at org.jboss.deployment.MainDeployer.create(MainDeployer.java:959)
  | 	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
  | 	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
  | 	at sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source)
  | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | 	at java.lang.reflect.Method.invoke(Method.java:585)
  | 	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  | 	at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  | 	at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  | 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  | 	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
  | 	at $Proxy9.deploy(Unknown Source)
  | 	at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
  | 	at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
  | 	at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
  | 	at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
  | 	at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
  | 	at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
  | 	at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
  | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | 	at java.lang.reflect.Method.invoke(Method.java:585)
  | 	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
  | 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  | 	at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
  | 	at $Proxy0.start(Unknown Source)
  | 	at org.jboss.system.ServiceController.start(ServiceController.java:417)
  | 	at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
  | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | 	at java.lang.reflect.Method.invoke(Method.java:585)
  | 	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
  | 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  | 	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
  | 	at $Proxy4.start(Unknown Source)
  | 	at org.jboss.deployment.SARDeployer.start(SARDeployer.java:304)
  | 	at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
  | 	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
  | 	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
  | 	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
  | 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | 	at java.lang.reflect.Method.invoke(Method.java:585)
  | 	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  | 	at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  | 	at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  | 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  | 	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
  | 	at $Proxy5.deploy(Unknown Source)
  | 	at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
  | 	at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
  | 	at org.jboss.Main.boot(Main.java:200)
  | 	at org.jboss.Main$1.run(Main.java:508)
  | 	at java.lang.Thread.run(Thread.java:595)
  | 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)
  | 	at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
  | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | 	at java.lang.reflect.Method.invoke(Method.java:585)
  | 	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  | 	at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  | 	at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  | 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  | 	at org.jboss.mx.server.MBeanServerImpl$3.run(MBeanServerImpl.java:1422)
  | 	at java.security.AccessController.doPrivileged(Native Method)
  | 	at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1417)
  | 	at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1350)
  | 	at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:345)
  | 	at org.jboss.system.ServiceCreator.install(ServiceCreator.java:181)
  | 	at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:451)
  | 	at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
  | 	... 80 more
  | 

I don't understand why the exception is getting thrown. There is a MailServiceMBean interface that the MailService implements. What am I missing?


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257147#4257147

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4257147



More information about the jboss-user mailing list