3 Replies Latest reply on Jul 18, 2007 8:36 PM by j h

    Deploy MBean service get No ClassLoaders found exception

    j h Newbie

      Greetings all,

      I am using JBoss 3.2.5 to implement a mail listener and deploy it as an MBean service. I follow the sample of HelloWorld mbean service tutorial on the wiki site,
      1. create an interface:
      public interface TopicMailListenerMBean extends ServiceMBean{
      public String getName();
      public void setName(String name);
      public String getUrl();
      public void setUrl(String url);
      public void disconnect() throws JMSException;
      }
      2. create mbean class:
      public class TopicMailListener extends ServiceMBeanSupport
      implements MessageListener, TopicMailListenerMBean {
      public void onMessage(Message msg) {...}
      ...
      }
      3. create a jboss-service.xml
      <?xml version="1.0" encoding="UTF-8"?>


      10.65.240.244:1099
      topic/testTopic

      4. deploy the war to jboss, and rename it to .sar, the hirarche of the sar is:
      test.sar
      test.sar/META-INF/jboss-service.xml
      test.sar/au/gov/nsw/community/mail/TopicMailListener.class
      test.sar/au/gov/nsw/community/mail/TopicMailListenerMBean.class

      Now, once I deploy the .sar in the JBOSSHOME/server/all/deploy, I always get following exceiption:
      2007-07-18 12:33:05,640 DEBUG [org.jboss.system.ServiceCreator] About to create bean: au.gov.nsw.community.mail:service=TopicMailListener with code: au.gov.nsw.community.mail.TopicMailListener
      2007-07-18 12:33:05,671 DEBUG [org.jboss.deployment.SARDeployer] create operation failed for package file:/D:/Adobe/LiveCycle/jboss/server/all/deploy/Docs.sar
      org.jboss.deployment.DeploymentException: No ClassLoaders found for: au.gov.nsw.community.mail.TopicMailListener; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: au.gov.nsw.community.mail.TopicMailListener)
      at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:139)
      at org.jboss.system.ServiceController.install(ServiceController.java:198)
      at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy4.install(Unknown Source)
      at org.jboss.deployment.SARDeployer.create(SARDeployer.java:204)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:790)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:644)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:608)
      at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:304)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:478)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:212)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)
      Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: au.gov.nsw.community.mail.TopicMailListener
      at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:275)
      at org.jboss.mx.loading.UnifiedClassLoader3.loadClassImpl(UnifiedClassLoader3.java:178)
      at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:132)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
      at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:843)
      at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:290)
      at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:317)
      at org.jboss.system.ServiceCreator.install(ServiceCreator.java:98)
      at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:149)
      at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:114)
      ... 32 more

      Could anybody tell me where is wrong? I do appreciate for any help in advance!

      Cheers,
      hj