Note that there are some explanatory texts on larger screens.

plurals
  1. POAppEngine: REST with Jersey not working
    primarykey
    data
    text
    <p>Within SpringSource Tool Suite I created a standard google app engine project. I added Jersey for REST support. The development server starts up fine, but when I try to GET a URL (e.g. <a href="http://localhost:8888/sibibjersey/api" rel="nofollow">http://localhost:8888/sibibjersey/api</a>) I'm simply getting a 404. I suppose this is a simple configuration issue, but the solutions seems to hide away from me....</p> <p>Here the main files:</p> <p>web.xml looks like this.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"&gt; &lt;init-param&gt; &lt;param-name&gt;com.sun.jersey.config.feature.DisableWADL&lt;/param-name&gt; &lt;param-value&gt;true&lt;/param-value&gt; &lt;/init-param&gt; &lt;servlet&gt; &lt;servlet-name&gt;Jersey Web Application&lt;/servlet-name&gt; &lt;servlet-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&lt;/servlet-class&gt; &lt;init-param&gt; &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt; &lt;param-value&gt;com.sibib.main&lt;/param-value&gt; &lt;/init-param&gt; &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;Jersey Web Application&lt;/servlet-name&gt; &lt;url-pattern&gt;/&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;/web-app&gt; </code></pre> <p>I tried variations of the url-pattern like /* and /rest/*, but none seemed to work.</p> <p>The only Java class in com.sibib.main is InfoResource.java:</p> <pre><code>package com.sibib.main; import javax.ws.rs.GET; import javax.ws.rs.Path; @Path("/api") public class InfoResource { @GET public String info() { return "Hello Jersey on Google App Engine"; } } </code></pre> <p>I tried adding @Path to the info function, but no effect. When I start the server and navigate e.g. to <a href="http://localhost:8888/sibibjersey/api" rel="nofollow">http://localhost:8888/sibibjersey/api</a> I'm simply getting a 404. Loading <a href="http://localhost:8888" rel="nofollow">http://localhost:8888</a> loads the index.html in the war folder.</p> <p>These are the lib referenced in the project: </p> <ul> <li>activation-1.1.1.jar</li> <li>appengine-api-1.0-sdk-1.6.1.jar</li> <li>appengine-api-labs-1.6.1.jar</li> <li>appengine-jsr107cache-1.6.1.jar</li> <li>asm-3.3.1.jar</li> <li>datanucleus-appengine-1.0.10.final.jar</li> <li>datanucleus-core-1.1.5.jar</li> <li>datanucleus-jpa-1.1.5.jar</li> <li>geronimo-jpa_3.0_spec-1.1.1.jar</li> <li>geronimo-jta_1.1_spec-1.1.1.jar</li> <li>google_sql.jar</li> <li>jackson-core-asl-1.9.2.jar</li> <li>jackson-jaxrs-1.9.2.jar</li> <li>jackson-mapper-asl-1.9.2.jar</li> <li>jaxb-api-2.2.4.jar</li> <li>jaxb-impl-2.2.4-1.jar</li> <li>jdo2-api-2.3-eb.jar</li> <li>jersey-bundle-1.11.jar</li> <li>jersey-client-1.11.jar</li> <li>jersey-core-1.11.jar</li> <li>jersey-json-1.11.jar</li> <li>jersey-server-1.11.jar</li> <li>jettison-1.1.jar</li> <li>jsr107cache-1.1.jar</li> <li>persistence-api-1.0.2.jar</li> <li>stax-api-1.0-2.jar</li> </ul> <p>Any hint is greatly appreciated!</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    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