I have a simple restlet Component that contain the HTTP server and client
connectors and a simple 
Application that redirects a call from the HTTP server connector to the HTTP
client connector (I am 
basically using getDispatcher().get(uri) in my resource handleGet). Here is the
main code:

        Component comp = new Component();
        comp.getServers().add(Protocol.HTTP, 3000);
        comp.getClients().add(Protocol.HTTP);

        DocumentApplication app = new MyApp(comp.getContext());
        comp.getDefaultHost().attach("/app", app);
        comp.start();


For whatever reason the getDispatcher().get() is not reaching my HTTP client
after seeing the following 
message:

"The protocol used by this request is not declared in the application's
connector service."

After some debugging I noticed that the ApplicationDispatcher is first checking
to see if the 
Application.connectorService contains the given client protocol. It seems then
that for each Client 
added to a component one also has to add the Client protocols to the
Application.connectorService. It 
did exactly that with:

        app.getConnectorService().getClientProtocols().add(Protocol.HTTP);
 
The getDispatcher().get("http://...";) still didnt work. I then noticed that
there is a apples and oranges 
comparison in ComponentHelper line 188. It seems to be look for a request
protocol in a list of clients.

Is this a bug or this is not the right way to redirect to client connectors?

Thanks,

-- yuri 

Reply via email to