Hi all,
I am a beginner to restlet. I am trying to use restlet for my android client
and google app engine server.
I tired executing a program that I got from Restlet webiste but it is
showing the warning
"The protocol used by this request is not declared in the list of client
connectors. (FILE)" even after adding the following line in the code
component.getClients().add(Protocol.CLAP);
Here is the code for server using google app engine and restlet:
package server.application;
import java.io.File;
import org.restlet.Application;
import org.restlet.Component;
import org.restlet.Restlet;
import org.restlet.data.LocalReference;
import org.restlet.data.Protocol;
import org.restlet.resource.Directory;
import org.restlet.routing.Router;
public class TestServerApplication extends Application {
/**
* When launched as a standalone application.
*
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
Component component = new Component();
component.getServers().add(Protocol.HTTP, 8080);
component.getClients().add(Protocol.CLAP);
component.getClients().add(Protocol.FILE);
component.getDefaultHost().attach(new TestServerApplication());
component.start();
}
@Override
public Restlet createInboundRoot() {
Router router = new Router(getContext());
getConnectorService().getClientProtocols().add(Protocol.FILE);
// Serve the files generated by the GWT compilation step.
File warDir = new File("");
if (!"war".equals(warDir.getName())) {
warDir = new File(warDir, "war/");
}
// final Directory dir = new Directory(getContext(),
"clap://class/web/restlet_docs/schema/".createFileReference(warDir)));
Directory dir = new Directory(getContext(), LocalReference
.createFileReference(warDir));
router.attachDefault(dir);
router.attach("/contacts/123", ContactServerResource.class);
return router;
}
}
*****
When I try to run the server it shows
INFO: The server is running at http://localhost:3165/
but when I go to this url and click the link it shows the error message
org.restlet.engine.component.ClientRouter getNext
WARNING: The protocol used by this request is not declared in the list of
client connectors. (FILE)
Please help me out.
Thanks in advance
--
View this message in context:
http://restlet-discuss.1400322.n2.nabble.com/The-protocol-used-by-this-request-is-not-declared-in-the-list-of-client-connectors-FILE-tp6006629p6006629.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2702949