简体   繁体   English

Restlet GAE示例不适用于Google App Engine工具包1.4.0

[英]Restlet GAE sample doesn't work with Google App Engine Toolkit 1.4.0

I run GAE in Eclipse. 我在Eclipse中运行GAE。 What I did was just following instructions from sample: http://wiki.restlet.org/docs_2.0/13-restlet/275-restlet/252-restlet.pdf 我所做的只是遵循示例中的说明: 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: 当我尝试访问URL localhost:8888 / resttest时,出现异常:

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. 我尝试了不同版本的Restlets。 Any idea how to get this working? 任何想法如何使它工作?

Yes, I use the GAE in Eclipse. 是的,我在Eclipse中使用GAE。 web.xml: 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.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>

可能您忘了添加一个jar:像我一样添加了org.restlet.ext.servlet.jar

Are you using the Google Plugin for Eclipse? 您是否正在使用Eclipse的Google插件? If not, I recommend you install the plugin as it simplifies the process somewhat. 如果没有,我建议您安装该插件,因为它在某种程度上简化了该过程。

Can you paste your web.xml file? 您可以粘贴web.xml文件吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM