Hello,

I am trying to use the invoke method from the RemoteAdaptor, I can get it to work if I 
call an MBean method that takes no parameters like follows.
              // The connection URL.
              String endpoint = "http://roosevelt/jboss-net/services/RemoteAdaptor";;

              Service service = new Service();
              Call    call    = (Call) service.createCall();
              call.setTargetEndpointAddress( new java.net.URL(endpoint) );
              //call.setOperationName("getDefaultDomain");
              //System.out.println("Default Domain: "+ call.invoke( new Object[]{}));
              
              QName qn = new QName("http://net.jboss.org/jmx";, "ObjectNameType");
              call.registerTypeMapping(ObjectName.class, qn, 
                        new ObjectNameSerializerFactory(ObjectName.class, qn),
                                        new 
ObjectNameDeserializerFactory(ObjectName.class, qn));
              
              call.setOperationName("invoke");       
              Object info = call.invoke(new Object[]{
                        new ObjectName("jnms.test:service=HibernateTest"), 
                                new String("runGetAllTest"),
                                new Object[]{},
                                new String[]{}
                                });
              //call.setOperationName("getMBeanCount");
              //Object info = call.invoke(new Object[]{});            
              
              System.out.println("Info: "+info);

However if I have a void method that takes a String argument I get an error, here is 
how I try to a use the "invoke" method and the error.

        Code:      // The connection URL.
              String endpoint = "http://roosevelt/jboss-net/services/RemoteAdaptor";;

              Service service = new Service();
              Call    call    = (Call) service.createCall();
              call.setTargetEndpointAddress( new java.net.URL(endpoint) );
              //call.setOperationName("getDefaultDomain");
              //System.out.println("Default Domain: "+ call.invoke( new Object[]{}));
              
              QName qn = new QName("http://net.jboss.org/jmx";, "ObjectNameType");
              call.registerTypeMapping(ObjectName.class, qn, 
                        new ObjectNameSerializerFactory(ObjectName.class, qn),
                                        new 
ObjectNameDeserializerFactory(ObjectName.class, qn));
              
              call.setOperationName("invoke");       
              Object info = call.invoke(new Object[]{
                        new ObjectName("jnms.test:service=HibernateTest"), 
                                new String("runCreateObjectAndChildTxTest"),
                                new Object[]{"test"},
                                new String[]{"String"}
                                });
              //call.setOperationName("getMBeanCount");
              //Object info = call.invoke(new Object[]{});            
              
              System.out.println("Info: "+info);
        }



Error:
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
 faultSubcode: 
 faultString: Problems while interfacing JMX.; nested exception is: 
        MBeanException: ReflectionException: null
Cause: java.lang.IllegalArgumentException: Unable to find operation 
runCreateObjectAndChildTxTest(String)
Cause: ReflectionException: null
Cause: java.lang.IllegalArgumentException: Unable to find operation 
runCreateObjectAndChildTxTest(String)
 faultActor: 
 faultNode: 
 faultDetail: 
        {http://xml.apache.org/axis/}stackTrace: AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
 faultSubcode: 
 faultString: Problems while interfacing JMX.; nested exception is: 
        MBeanException: ReflectionException: null
Cause: java.lang.IllegalArgumentException: Unable to find operation 
runCreateObjectAndChildTxTest(String)
Cause: ReflectionException: null
Cause: java.lang.IllegalArgumentException: Unable to find operation 
runCreateObjectAndChildTxTest(String)
 faultActor: 
 faultNode: 
 faultDetail: 

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3840320#3840320

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3840320


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to