This really drives me nuts, hope someone can help me.
Hundreds of examples on the net gives examples on setting up an XMLRPC
server with the Apache XMLRPC (even apache.org itself).
But none of them work for me, because they all call a method
addHandler, which clearly does not exist in any of the packages, I
even scanned the source code, but nothing found. Here's the code and
the failure that follows :
import org.apache.xmlrpc.webserver.*;
public class JavaServer {
public Integer sum(int x, int y) {
return new Integer(x+y);
}
public static void main (String [] args) {
try {
System.out.println("Attempting to start XML-RPC Server...");
WebServer server = new WebServer(1234);
server.addHandler("sample", new JavaServer());
server.start();
System.out.println("Started successfully.");
System.out.println("Accepting requests. (Halt program to
stop.)");
} catch (Exception exception) {
System.err.println("JavaServer: " + exception);
}
}
}
Exception in thread "main" java.lang.Error: Unresolved compilation
problem:
The method addHandler(String, JavaServer) is undefined for the type
WebServer
at JavaServer.main(JavaServer.java:14)
What is happening ?? The error is obvious, but why do everyone use
this addHandler in their examples, when it does not exist ?!
- Dan Hansen
HansH