Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

addHandler does not exist in xmlrpc JAVA api

37 views
Skip to first unread message

Dan Hansen

unread,
Dec 16, 2009, 6:25:57 AM12/16/09
to
Hi All,

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

unread,
Dec 16, 2009, 1:50:51 PM12/16/09
to
"Dan Hansen" <dan.han...@gmail.com> schreef in bericht
news:255fe670-2635-4baa...@p19g2000vbq.googlegroups.com...

> 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 p...
'addHandler' is just an Apache configuration directive provided by mod_mime:
http://httpd.apache.org/docs/2.2/mod/mod_mime.html#addhandler

HansH


0 new messages