0 Replies Latest reply on Sep 9, 2008 10:51 AM by Jon Loe

    unable to find operation startSingleton

    Jon Loe Newbie

      hi all...i'm trying to configure a jmx mbean to be a singleton (in a clustered env). i think i did all the steps, but jboss (4.2.3) is throwing an exception. here's my mbean definitions:

      <mbean code="org.jboss.ha.singleton.HASingletonController"
       name="org.dcri.jobmanager.jmx:service=JobManager-HASingletonController">
       <depends>jboss:service=DefaultPartition</depends>
       <depends>
       org.dcri.jobmanager.jmx:service=JobManager,job=REPORT(reporting-service-${application.version})
       </depends>
       <attribute name="TargetName">
       org.dcri.jobmanager.jmx:service=JobManager,job=REPORT(reporting-service-${application.version})
       </attribute>
       <attribute name="TargetStartMethod">startSingleton</attribute>
       <attribute name="TargetStopMethod">stopSingleton</attribute>
       </mbean>
      


      <mbean code="org.dcri.jobmanager.jmx.JobManager"
       name="org.dcri.jobmanager.jmx:service=JobManager,job=REPORT(reporting-service-${application.version})">
      
       <!-- Attribute Job, type XML Fragment, Configures the Job class run
       by the Job Manager -->
       <attribute name="Job">
       <job>
       <!--The job class that will be instantiated and run through
       the JobManager -->
       <class>org.dcri.reporting.jobmanager.jobs.ReportJob</class>
       <properties>
       <property name="namespace">${application.name}-${application.version}</property>
       <property name="jobManagerHost">${jobmanager.service.host}</property>
       <property name="jobManagerPort">${jobmanager.service.port}</property>
       <property name="jobManagerScheme">${jobmanager.service.scheme}</property>
       <property name="jobManagerVersion">${jobmanager.service.version}</property>
       <!--The realm through which to login, and authenticate-->
       <property name="securityRealm">jobmanager-service</property>
       <!--The principal's username through which we authenticate -->
       <property name="username">${jobmanager.service.username}</property>
       <!--The principal's password through which we authenticate -->
       <property name="password">${jobmanager.service.password}</property>
       <!-- The age in days of JobRequests to find and process-->
       <property name="daysBack">8</property>
       <!-- the status of job requests to find and process -->
       <property name="status">SUBMITTED</property>
       <property name="reportingSecurityRealm">client-login</property>
       </properties>
       </job>
       </attribute>
       <!--type long, The interval at which the Job will be processed in milliseconds -->
       <attribute name="Interval">${job.report.interval}</attribute>
       <!--occurrences long, The number of intervals that will occurr
       0 is unlimited -->
       <attribute name="Occurrences">0</attribute>
       <attribute name="AutoStart">true</attribute>
       <!--type java.lang.String, The date when this Job will start -->
       <!-- <attribute name="StartDate">1/23/2003</attribute> -->
       <!--type java.lang.String, The date when this Job will end -->
       <!-- <attribute name="EndDate">1/25/2003</attribute> -->
       </mbean>
      


      In the class org.dcri.reporting.jobmanager.jobs.ReportJob i have the followoing operations defined:

      private boolean isMasterNode = false;
      
       public void startSingleton() {
       System.out.println("\n\n\nReportJob...startSingleton -> " + isMasterNode);
       isMasterNode = true;
       }
      
       public boolean isMasterNode() {
       System.out.println("\n\n\nReportJob...isMasterNode -> " + isMasterNode);
       return isMasterNode;
       }
      
       public void stopSingleton() {
       System.out.println("\n\n\nReportJob...stopSingleton -> " + isMasterNode);
       isMasterNode = false;
       }
      


      But, I'm getting the following exception:


      08:22:04,220 DEBUG [ServiceController] Starting dependent components for: org.dcri.jobmanager.jmx:service=JobManager,job
      =REPORT(reporting-service-1.3.1) dependent components: [ObjectName: org.dcri.jobmanager.jmx:service=JobManager-HASinglet
      onController
       State: CREATED
       I Depend On:
       jboss:service=DefaultPartition
       org.dcri.jobmanager.jmx:service=JobManager,job=REPORT(reporting-service-1.3.1)
      ]
      08:22:04,222 DEBUG [ServiceController] starting service org.dcri.jobmanager.jmx:service=JobManager-HASingletonController
      
      08:22:04,223 DEBUG [HASingletonController] Starting org.dcri.jobmanager.jmx:service=JobManager-HASingletonController
      08:22:04,223 DEBUG [HASingletonController] start HAServiceMBeanSupport
      08:22:04,224 DEBUG [HASingletonController] findHAPartitionWithName, name=DefaultPartition
      08:22:04,235 DEBUG [HASingletonController] partitionTopologyChanged, isElectedNewMaster=true, isMasterNode=false, viewID
      =-35945124
      08:22:04,236 DEBUG [HASingletonController] startNewMaster, isMasterNode=false
      08:22:04,236 DEBUG [HASingletonController] startSingleton() : elected for master singleton node
      08:22:04,237 DEBUG [HASingletonController] Calling operation: startSingleton(), on target: 'org.dcri.jobmanager.jmx:serv
      ice=JobManager,job=REPORT(reporting-service-1.3.1)'
      08:22:04,237 ERROR [HASingletonController] Controlled Singleton MBean failed to become master
      javax.management.ReflectionException
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:231)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.ha.singleton.HASingletonController.invokeSingletonMBeanMethod(HASingletonController.java:207)
       at org.jboss.ha.singleton.HASingletonController.startSingleton(HASingletonController.java:144)
       at org.jboss.ha.singleton.HASingletonSupport.startNewMaster(HASingletonSupport.java:272)
       at org.jboss.ha.singleton.HASingletonSupport.makeThisNodeMaster(HASingletonSupport.java:254)
       at org.jboss.ha.singleton.HASingletonSupport.partitionTopologyChanged(HASingletonSupport.java:196)
       at org.jboss.ha.jmx.HAServiceMBeanSupport$1.replicantsChanged(HAServiceMBeanSupport.java:247)
       at org.jboss.ha.framework.server.DistributedReplicantManagerImpl.notifyKeyListeners(DistributedReplicantManagerI
      mpl.java:846)
       at org.jboss.ha.framework.server.DistributedReplicantManagerImpl.add(DistributedReplicantManagerImpl.java:409)
       at org.jboss.ha.jmx.HAServiceMBeanSupport.registerDRMListener(HAServiceMBeanSupport.java:255)
       at org.jboss.ha.jmx.HAServiceMBeanSupport.startService(HAServiceMBeanSupport.java:177)
       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:597)
       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 org.jboss.system.ServiceController.start(ServiceController.java:435)
       at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       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.start(MainDeployer.java:1015)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
       at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       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:26
      3)
       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:597)
       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:597)
       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:597)
       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:619)
      Caused by: java.lang.IllegalArgumentException: Unable to find operation startSingleton()
       ... 105 more
      08:22:04,269 DEBUG [HASingletonController] Started org.dcri.jobmanager.jmx:service=JobManager-HASingletonController
      08:22:04,269 DEBUG [ServiceController] Starting dependent components for: org.dcri.jobmanager.jmx:service=JobManager-HASingletonController dependent components: []
      08:22:04,273 DEBUG [RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@
      56de9984, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@5debf305{ url=null ,addedOrder=0}
      08:22:04,277 DEBUG [MainDeployer] End deployment start on package: jobmanager-service-jmx-1.2.1.sar
      08:22:04,277 DEBUG [MainDeployer] Begin deployment start file:/C:/work/jboss-4.2.3.GA/server/all/tmp/deploy/tmp42371repo
      rting-service-app-1.3.1.ear-contents/reporting-service-core-1.3.1.jar
      08:22:04,278 DEBUG [EJBDeployer] start application, deploymentInfo: org.jboss.deployment.DeploymentInfo@d9ce7249 { url=f
      ile:/C:/work/jboss-4.2.3.GA/server/all/tmp/deploy/tmp42371reporting-service-app-1.3.1.ear-contents/reporting-service-cor
      e-1.3.1.jar }
      


      can someone let me know if my config is wrong or i forgot a step ?

      thanks