2 Replies Latest reply on May 8, 2009 4:17 AM by ekobir

    Failed Deployment of Singleton Service on jboss eap 5.0.0

      Hi All

      I'm struggling to deploy singleton jboss service. Can you provide some feedback what it is wrong with following config file?

      The problem is that I'm not able to set TargetName attribute of HASingletonController.

      Note: I'm using jboss-eap-5.0--> Supported Alpha Version


      11:48:55,438 ERROR [AbstractKernelController] Error installing to Configured: name=xyz:service=TestServiceHASingletonController state=Instantiated mode=Manual requiredState=Configured
      java.lang.RuntimeException: Exception setting attribute TargetName on mbean xyz:service=TestServiceHASingletonController

      Caused by: javax.management.InvalidAttributeValueException: Set attribute has class class javax.management.ObjectName loaded from null that is not assignable to attribute class class javax.management.ObjectName loaded from BaseClassLoader@15b9a0c

      public interface TestServiceMBean extends HAServiceMBean {
      
       public void startSingleton();
      
       public void stopSingleton();
      
      }
      
      
      public class TestService extends HAServiceMBeanSupport
       implements TestServiceMBean {
      
       private static Logger logger = Logger.getLogger(
       TestService.class);
      
      
       @Override
       public void startSingleton() {
       logger.info("Start Singleton Service");
       }
      
       @Override
       public void stopSingleton(){
       logger.info("Stop Singleton Service");
       }
      
       @Override
       protected void createService() throws Exception {
       super.createService();
       logger.info("Create Service");
       }
      
       @Override
       protected void startService() throws Exception {
       super.startService();
       logger.info("Start Service");
       }
      
       @Override
       protected void stopService() throws Exception {
       super.stopService();
       logger.info("Stop Service");
       }
      
       @Override
       protected void destroyService() throws Exception {
       super.destroyService();
      
       logger.info("Destroy Service");
       }
      }
      
      <?xml version="1.0" encoding="UTF-8" ?>
      <server>
       <mbean
       code="xyz.TestService"
       name="xyz:service=TestService">
       <!--
       I tried to inject HAPartition like below as setting ClusteredPartition is deprecated,
       unfortunately it didnt work
      
       <depends>HAPartition</depends>
       <property name="HAPartition"><inject bean="HAPartition"/></property>
       -->
      
       <depends optional-attribute-name="ClusterPartition" proxy-type="attribute">
       jboss:partition=${jboss.partition.name:DefaultPartition},service=HAPartition
       </depends>
       </mbean>
      
       <mbean code="org.jboss.ha.singleton.HASingletonController"
       name="xyz:service=TestServiceHASingletonController">
       <depends optional-attribute-name="ClusterPartition" proxy-type="attribute">
       jboss:partition=${jboss.partition.name:DefaultPartition},service=HAPartition
       </depends>
       <depends optional-attribute-name="TargetName">
       xyz:service=TestService
       </depends>
       <attribute name="TargetStartMethod">startSingleton</attribute>
       <attribute name="TargetStopMethod">stopSingleton</attribute>
       </mbean>
      </server>