ws-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Ruediger <>
Subject handler not found, not registered
Date Wed, 06 Oct 2004 09:05:02 GMT
Hi there,

as described on the hp i implemented a somple class with a methos to
be invoced.
classname = Location ; methodname = locate
I registered the class in the init method of my servlet, but on some
reasons, when i try to access the server i get this message (code of
clesses beneath):

java.lang.Exception: RPC handler object "location" not found and no
default handler registered
org.apache.xmlrpc.XmlRpcException: java.lang.Exception: RPC handler
object "location" not found and no default handler registered
	at org.apache.xmlrpc.XmlRpcClient$Worker.execute(
	at org.apache.xmlrpc.XmlRpcClient.execute(
	at gsmadaptateurs.OrangeGSMAdaptateur.demandePosition(
	at testgroupe1.GSMAdaptateurOrangeTest.testAdaptateur(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at junit.framework.TestCase.runTest(
	at junit.framework.TestCase.runBare(
	at junit.framework.TestResult$1.protect(
	at junit.framework.TestResult.runProtected(
	at junit.framework.TestSuite.runTest(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(

So can anyone give me a hint what went wrong?
Thanx in advance

Christian Ruediger

public class Location {

    public Vector locate(Vector input){
        Iterator iterator = input.iterator(); 
        return input;

public static XmlRpcServer xmlrpc = new XmlRpcServer();  
    public void init (ServletConfig config) throws ServletException   {

        xmlrpc = new XmlRpcServer();
        System.out.println("Serveur initialisation avec Location handler");
        xmlrpc.addHandler("location.locate", new Location());         

        XmlRpcHandlerMapping hmp = xmlrpc.getHandlerMapping();         
        try {
        } catch (Exception e) {
            System.out.println("location.locate not registered");

protected void doPost(HttpServletRequest req,
            HttpServletResponse res)
    throws ServletException, IOException
        //get authorization header from request
        String auth=req.getHeader("Authorization");
        if (!auth.toUpperCase().startsWith("BASIC")) {
           throw new ServletException("wrong kind of authorization!");
        //get encoded username and password    
        String userPassEncoded=auth.substring(6);
        //create a base64 decoder using Sun utility class
        sun.misc.BASE64Decoder dec = new sun.misc.BASE64Decoder(  );
        String userPassDecoded= new String(dec.decodeBuffer(userPassEncoded));
        //split decoded username and password
        StringTokenizer userAndPass=new StringTokenizer(userPassDecoded,":");
        String username=userAndPass.nextToken(  );
        String password=userAndPass.nextToken(  );
        //send input stream, username, and password to xmlrpc.execute
        byte[] result = xmlrpc.execute(req.getInputStream(), username,
        //byte[] result = "Eine Menge Text!".getBytes();
        OutputStream output = res.getOutputStream();

View raw message