Exception in thread "Thread-4" java.lang.InstantiationError: org.apache.xmlrpc.XmlRpcRequest
at org.apache.xmlrpc.XmlRpcRequestProcessor.decodeRequest(XmlRpcRequestProcessor.java:82)
at org.apache.xmlrpc.XmlRpcWorker.execute(XmlRpcWorker.java:143)
at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:139)
at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:125)
at org.apache.xmlrpc.WebServer$Connection.run(WebServer.java:761)
at org.apache.xmlrpc.WebServer$Runner.run(WebServer.java:642)
at java.lang.Thread.run(Unknown Source)
This is the error I am getting when I run my client code on localhost in XML-RPC. I have made server and client in JAVA. my server process seems to be running ok. It is waiting for client requests successfully.
Following is my code for client.
package rpcpkg;
import java.net.URL;
import java.util.Vector;
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
public class SimpleXmlrpc {
public SimpleXmlrpc() {
}
public static void main(String[] args) {
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
try{
config.setServerURL(new URL("http://localhost:8089/workspace3/JAVARPC/RPCSRC/rpcserverpkg/"));
XmlRpcClient client = new XmlRpcClient();
client.setConfig(config);
Vector params = new Vector();
params.addElement(new Integer(17));
params.addElement(new Integer(13));
Object result = client.execute("sample.sum", params);
int sum = ((Integer) result).intValue();
System.out.println("The sum is: "+ sum);
}
catch(Exception e)
{
System.out.println("Exception: " + e.getMessage());
}
}
}