3 Replies Latest reply on Mar 7, 2013 2:52 PM by Jay SenSharma

    Problem deploying MBean

    Nitesh Mehta Newbie

      Hi,

       

      I have created a MBean and have deployed in Jboss 7.1.1 final.

      The problem I am facing is, when I try to invoke methods of MBean, for some of methods is says NoSuchMethodException when I see it in JConsole, some of the methods have been converted into attributed.

      Am I doing something wrong here?

       

      //MBean
      package com.testmbean;
      
      
      public interface TestServiceMBean {
      
      
                public String getServiceId();
                public Long currentTime();
                public void setId(String id);
                public void logMsg(String message);
      }
      
      //Impl
      package com.testmbean;
      
      
      public class TestService implements TestServiceMBean {
      
      
                public TestService() {}
          public void start() throws Exception
          {
          
          }
      
      
         public void stop() throws Exception
          {
                   
          }
      @Override
      public String getServiceId() {
                return "MY_SERVICE_ID";
      }
      @Override
      public Long currentTime() {
                return System.currentTimeMillis();
      }
      @Override
      public void setId(String id) {
                System.out.println( id);
        
      }
      @Override
      public void logMsg(String message) {
                System.out.println(message);
        
      }
      
      
      }
      

       

      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.testmbean.TestService" name="service.server.testmbean:service=TestService">
          </mbean>
      
      
      </server>
      

       

      JConsole View

      mbeanError.png