9 Replies Latest reply on Jan 3, 2013 11:24 AM by Joern Ohmen

    How to specify a SAR's module dependencies?

    Matt Drees Master

      Hi all,

       

      I'm trying to get a simple SAR deployed to AS7.  It has an mbean class in it that implements ServiceMBean.  However, when I deploy it, I get a ClassNotFoundException for ServiceMBean.  I suspect I need to somehow tell Jboss Modules that my SAR needs to access whichever module has that class.  But I don't know how to do that.  I suspect http://docs.jboss.org/author/display/MODULES/Manifest+module+information is what I'd need, except that that page hasn't been written yet.  Any suggestions?

       

       

      Log output:

       

      15:15:00,565 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Starting deployment of "jboss-addons-3.0-SNAPSHOT.sar"
      15:15:00,633 WARN  [org.jboss.modules] (MSC service thread 1-3) Failed to define class org.ccci.ha.HighAvailabilityDataSourceMBean in Module "deployment.jboss-addons-3.0-SNAPSHOT.sar:main" from Service Module Loader: java.lang.LinkageError: Failed to link org/ccci/ha/HighAvailabilityDataSourceMBean (Module "deployment.jboss-addons-3.0-SNAPSHOT.sar:main" from Service Module Loader)
          at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:398) [:1.0.0.CR2]
          at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:258) [:1.0.0.CR2]
          at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:75) [:1.0.0.CR2]
          at org.jboss.modules.Module.loadModuleClass(Module.java:588) [:1.0.0.CR2]
          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:180) [:1.0.0.CR2]
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:357) [:1.0.0.CR2]
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:329) [:1.0.0.CR2]
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:329) [:1.0.0.CR2]
          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:306) [:1.0.0.CR2]
          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:100) [:1.0.0.CR2]
          at java.lang.ClassLoader.defineClass1(Native Method) [:1.6.0_24]
          at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) [:1.6.0_24]
          at java.lang.ClassLoader.defineClass(ClassLoader.java:616) [:1.6.0_24]
          at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) [:1.6.0_24]
          at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:394) [:1.0.0.CR2]
          at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:258) [:1.0.0.CR2]
          at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:75) [:1.0.0.CR2]
          at org.jboss.modules.Module.loadModuleClass(Module.java:588) [:1.0.0.CR2]
          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:180) [:1.0.0.CR2]
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:357) [:1.0.0.CR2]
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:329) [:1.0.0.CR2]
          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:306) [:1.0.0.CR2]
          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:100) [:1.0.0.CR2]
          at java.lang.Class.forName0(Native Method) [:1.6.0_24]
          at java.lang.Class.forName(Class.java:247) [:1.6.0_24]
          at org.jboss.as.service.ReflectionUtils.getClass(ReflectionUtils.java:100)
          at org.jboss.as.service.ParsedServiceDeploymentProcessor.addServices(ParsedServiceDeploymentProcessor.java:111)
          at org.jboss.as.service.ParsedServiceDeploymentProcessor.deploy(ParsedServiceDeploymentProcessor.java:102)
          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1675)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_24]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_24]
          at java.lang.Thread.run(Thread.java:680) [:1.6.0_24]
      Caused by: java.lang.NoClassDefFoundError: org/jboss/system/ServiceMBean
          at java.lang.ClassLoader.defineClass1(Native Method) [:1.6.0_24]
          at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) [:1.6.0_24]
          at java.lang.ClassLoader.defineClass(ClassLoader.java:616) [:1.6.0_24]
          at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) [:1.6.0_24]
          at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:394) [:1.0.0.CR2]
          ... 32 more
      Caused by: java.lang.ClassNotFoundException: org.jboss.system.ServiceMBean from [Module "deployment.jboss-addons-3.0-SNAPSHOT.sar:main" from Service Module Loader]
          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:188) [:1.0.0.CR2]
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:357) [:1.0.0.CR2]
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:329) [:1.0.0.CR2]
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:329) [:1.0.0.CR2]
          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:306) [:1.0.0.CR2]
          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:100) [:1.0.0.CR2]
          ... 37 more
      

       

       

       

      Thanks for your time,

      -Matt