I run GAE in Eclipse. What I did was just following instructions from sample: http://wiki.restlet.org/docs_2.0/13-restlet/275-restlet/252-restlet.pdf
When I try to access the URL localhost:8888/resttest I get an exception:
javax.servlet.UnavailableException: java.lang.NullPointerException
at org.mortbay.jetty.servlet.ServletHolder.makeUnavailable(ServletHolder.java:415)
... the rest of stack trace
I tried with different versions of Restlets. Any idea how to get this working?
Yes, I use the GAE in Eclipse. web.xml:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app xmlns:xsi="http://www开发者_如何学Go.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">
<servlet>
<servlet-name>RestletServlet</servlet-name>
<servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
<init-param>
<param-name>org.restlet.application</param-name>
<param-value>secretPackage.FirstTestApplication</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>RestletServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
Are you using the Google Plugin for Eclipse? If not, I recommend you install the plugin as it simplifies the process somewhat.
Can you paste your web.xml file?
Probably you forgot to add a jar: org.restlet.ext.servlet.jar as I did.
精彩评论