2 Replies Latest reply on Oct 13, 2008 6:36 AM by jaikiran pai

    IllegalArgumentException: argument type mismatch

    r ui Newbie

      If I use Servlet to invoke the function of my mbean, and the function has a user-defined-class parameter, not int,string or else. It will throw a IllegalArgumentException: argument type mismatch. But from other way it runs correctly.

      Anyone who met this problem before?


      Example code:
      RMIAdaptor mBeanRMIAdaptor = (RMIAdaptor) ic.lookup("jmx/invoker/RMIAdaptor");
      ObjectName TestObjectName = new ObjectName("......");
      String[] sigs = { "test.TestObj" };
      Object[] params = { testObj };
      String result = (String) mBeanRMIAdaptor.invoke(TestObjectName, "testMethod", params, sigs);

      If you change the parameter to String , Int or other java type, it runs correctly.
      Or if you invoke it from a java application, it runs correctly too.