ClientResource always return null response

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ClientResource always return null response

Bluesoft70
Hi,
I have this server code:
public class Main {
    public static void main(String[] args) throws Exception {
        Component component = new Component();
        component.getServers().add(Protocol.HTTP, 8182);
        component.getDefaultHost().attach("/test", new TestApplication());      
        component.start();
    }
}

the application is:
public class TestApplication extends Application {
    public synchronized Restlet createInboundRoot() {
        Router router = new Router(getContext());
        router.attach("/log", TestResource.class);
        return router;
    }
}

the testresource is annontated, extends ServerResource and the responseobject is serializable. Pointing a webbrowser to the uri gives a xml output with the correct response.

I've created this se-testclient:
                ClientResource cr = new ClientResource("http://localhost:8182/test/log");
                LogResourceInterface log = cr.wrap(LogResourceInterface.class);
                System.out.println(log.getLog());

The response is always null and i just cant understand why. Am I missing something obvious here? I'm a kind of stuck here :-)
using 2.1.6 version

-Jon

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3070929
Reply | Threaded
Open this post in threaded view
|

RE: ClientResource always return null response

Bluesoft70
Well, it turned out to be a missing library on the client side. With absolutely no exception it was a bit confusing :-)

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3071109