0 Replies Latest reply on Aug 25, 2011 5:24 PM by jkreska

    How do I inject an instance of MBeanServer

    jkreska Newbie

      I have a service that registers some mbeans and jndi entries that I am porting from JBoss 4.  The di isn't wokring.

       

      jboss-service.xml

       

      <?xml version="1.0" encoding="UTF-8"?>
      
      <server xmlns="urn:jboss:service:7.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:service:7.0 jboss-service_7_0.xsd">
          <mbean code="com.xxi.framework.moduleservice.JBossModuleService" name="xxi.services:service=com.xxi.framework.moduleservice.JBossModuleService">
              <attribute name="MBeanServer">
                  <inject bean="JMXKernel" property="mbeanServer" />
              </attribute>
              <attribute name="ConfigurationURL" >${jboss.module-service.url}</attribute>
              <attribute name="ConfigurationFilename">${jboss.module-service.configurations}</attribute>
      
              <depends>jboss:service=Naming</depends>
          </mbean>
      </server>
      

       

      Error in log

       

      17:15:57,344 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-14) Starting deployment of "999-xxi-framework-module-service.sar"
      17:15:57,403 INFO  [org.jboss.as.jpa] (MSC service thread 1-3) added javax.persistence.api dependency to 999-xxi-framework-module-service.sar
      17:15:57,427 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-17) MSC00001: Failed to start service jboss.deployment.unit."999-xxi-framework-modul
      e-service.sar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."999-xxi-framework-module-service.sar".INSTALL: Failed to pr
      ocess phase INSTALL of deployment "999-xxi-framework-module-service.sar"
              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
              at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
              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:662) [:1.6.0_24]
      Caused by: java.lang.IllegalStateException: No such get method for property 'mbeanServer' found on class com.xxi.framework.moduleservice.JBossModuleService
              at org.jboss.as.service.ReflectionUtils.getGetter(ReflectionUtils.java:58)
              at org.jboss.as.service.ParsedServiceDeploymentProcessor.getValue(ParsedServiceDeploymentProcessor.java:163)
              at org.jboss.as.service.ParsedServiceDeploymentProcessor.addServices(ParsedServiceDeploymentProcessor.java:135)
              at org.jboss.as.service.ParsedServiceDeploymentProcessor.deploy(ParsedServiceDeploymentProcessor.java:102)
              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)
              ... 5 more
      
      17:15:57,431 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployment of 
      "999-xxi-framework-module-service.sar" was rolled back with failure message {"Failed services" => {"jboss.deployment.unit.\"999-xxi-framework-module-service.sar\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"999-xxi-framework-module-service.sar\".INSTALL: Failed to process phase INSTALL of deployment \"999-xxi-framework-mo