4 Replies Latest reply on May 15, 2006 8:47 AM by Élvio Andrade

    Unable to find operation

    Élvio Andrade Newbie

      Hi,

      I have this MBean that is exposed as a service:

      public interface WFEServiceMBean extends ServiceMBean {
      
      
       public List getInputs();
      
       void reset();
      
       void addElement(String elementInfo);
      }
      


      when I invoke operations on him through this:

      
      ObjectName objectName = new ObjectName("java:service=WFEService");
      MBeanServer server = MBeanServerLocator.locateJBoss();
      wfeService = (WFEServiceMBean)MBeanServerInvocationHandler.newProxyInstance(server, objectName, WFEServiceMBean.class, false);
      wfeService.reset();
      wfeService.addElement("teste");
      


      it works fine, when i invoke operations using:

      ObjectName objectName = new ObjectName("java:service=WFEService");
      MBeanServer server = MBeanServerLocator.locateJBoss();
      Object[] params = new Object[] {post};
      server.invoke(objectName, "reset", null, null);
      server.invoke(objectName, "addElement", params, new String[] {post.getClass().toString()});
      


      the invocation of the reset operation works but the addElement does not!! It throws this exception:

      
      Caused by: java.lang.IllegalArgumentException: Unable to find operation addElement(class java.lang.String)
      
      


      Does anyone has an explanation?

      best regards