2 Replies Latest reply on Jul 10, 2002 9:47 AM by usiwill

    JMX invoke causing Reflection exception. problem with signat

    usiwill

      Hello all,

      I am getting a reflection error when trying to invoke a JMX method from a stateless session bean.

      Here's what I'm trying to do:

      // Get instance to MBeanServer
      Collection col = MBeanServerFactory.findMBeanServer(null);
      if (col.isEmpty()) {
      throw new Exception("No MBeanServer found");
      }

      server = (MBeanServer)col.iterator().next();

      oname = new ObjectName("USiSphere:name=Scheduler");

      Long tbpID = new Long((long) bp.getTgtBusProcID());
      Object[] params = {tbpID};
      String[] signatures = {"Long"};

      server.invoke(oname, "retryTargetBusinessProcess", params, signatures);


      pretty simple. Here's the reflection error I am gettting back:

      ReflectionException: null Cause: java.lang.NoSuchMethodException: Unable to locate method for: retryTargetBusinessProcess(,Long)

      The problem obviously is the (,Long) parameters. No matter how many parameters I place into params[] and signatures[] it keeps trying to put the extra ',' into the method call.

      I am running jboss-3.0 under Java 1.4.0-b92 on Linux

      Thanks for any help,

      -Will