Note that there are some explanatory texts on larger screens.

plurals
  1. PORestlet Tutorial example
    primarykey
    data
    text
    <p>I am having trouble getting the <a href="http://wiki.restlet.org/docs_2.0/13-restlet/21-restlet/318-restlet/303-restlet.html" rel="nofollow">tutorial</a> example to work on GAE. AppEngine Log says:</p> <pre><code>"GET /contacts/123 HTTP/1.1" 404 598 - "Restlet-Framework/2.1snapshot,gzip(gfe)" javax.servlet.ServletContext log: ContactRestlet: [Restlet] Attaching application: com.sem.server.rest.ContactApp@1bbc779 to URI: /contacts/123 This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application. </code></pre> <p>I cannot reach it from my android client nor from the browser for that matter. Any help is appreciated!</p> <p>web.xml as follows</p> <pre><code>&lt;web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5"&gt; &lt;context-param&gt; &lt;param-name&gt;org.restlet.clients&lt;/param-name&gt; &lt;param-value&gt;CLAP FILE&lt;/param-value&gt; &lt;/context-param&gt; &lt;servlet&gt; &lt;servlet-name&gt;PoiServiceImpl&lt;/servlet-name&gt; &lt;servlet-class&gt;com.sem.server.PoiServiceImpl&lt;/servlet-class&gt; &lt;/servlet&gt; &lt;servlet&gt; &lt;servlet-name&gt;PoiRestlet&lt;/servlet-name&gt; &lt;servlet-class&gt;org.restlet.ext.servlet.ServerServlet&lt;/servlet-class&gt; &lt;init-param&gt; &lt;param-name&gt;org.restlet.application&lt;/param-name&gt; &lt;param-value&gt;com.sem.server.rest.PoiApp&lt;/param-value&gt; &lt;/init-param&gt; &lt;/servlet&gt; &lt;servlet&gt; &lt;servlet-name&gt;ContactRestlet&lt;/servlet-name&gt; &lt;servlet-class&gt;org.restlet.ext.servlet.ServerServlet&lt;/servlet-class&gt; &lt;init-param&gt; &lt;param-name&gt;org.restlet.application&lt;/param-name&gt; &lt;param-value&gt;com.sem.server.rest.ContactApp&lt;/param-value&gt; &lt;/init-param&gt; &lt;/servlet&gt; &lt;servlet&gt; &lt;servlet-name&gt;CatRestlet&lt;/servlet-name&gt; &lt;servlet-class&gt;org.restlet.ext.servlet.ServerServlet&lt;/servlet-class&gt; &lt;init-param&gt; &lt;param-name&gt;org.restlet.application&lt;/param-name&gt; &lt;param-value&gt;com.sem.server.rest.CatApp&lt;/param-value&gt; &lt;/init-param&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;PoiServiceImpl&lt;/servlet-name&gt; &lt;url-pattern&gt;/sem10/PoiService&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;PoiRestlet&lt;/servlet-name&gt; &lt;url-pattern&gt;/poi&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;ContactRestlet&lt;/servlet-name&gt; &lt;url-pattern&gt;/contacts/123&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;CatRestlet&lt;/servlet-name&gt; &lt;url-pattern&gt;/cat&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;!-- Default page to serve --&gt; &lt;welcome-file-list&gt; &lt;welcome-file&gt;Sem10.html&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;/web-app&gt; </code></pre> <p>ContactApp</p> <pre><code>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 ContactApp 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.getClients().add(Protocol.FILE); component.getServers().add(Protocol.HTTP, 8080); component.getDefaultHost().attach(new ContactApp()); 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/"); } Directory dir = new Directory(getContext(), LocalReference .createFileReference(warDir)); router.attachDefault(dir); router.attach("/contacts/123", ContactServResource.class); return router; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload