Google app engine 谷歌应用引擎HTTP错误403

Google app engine 谷歌应用引擎HTTP错误403,google-app-engine,Google App Engine,我正在尝试编写一个简单的谷歌应用程序引擎应用程序。我将学习本教程: ,但是我不能让它工作 在本地主机上测试时,我收到: HTTP ERROR 403 Problem accessing /. Reason: FORBIDDEN Powered by Jetty:// 这是我的申请代码: package test; import java.io.IOException; import javax.servlet.http.*; public class Test extends Ht

我正在尝试编写一个简单的谷歌应用程序引擎应用程序。我将学习本教程: ,但是我不能让它工作

在本地主机上测试时,我收到:

HTTP ERROR 403
Problem accessing /. Reason:
    FORBIDDEN
Powered by Jetty://
这是我的申请代码:

package test;

import java.io.IOException;
import javax.servlet.http.*;

public class Test extends HttpServlet {
    private static final long serialVersionUID = 1L;

    public void doGet(HttpServletRequest req, HttpServletResponse resp)
            throws IOException {
        resp.setContentType("text/plain");
        resp.getWriter().println("Hello, world");
    }
}
My web.xml文件:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE web-app PUBLIC
 "-//Oracle Corporation//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5">
    <servlet>
        <servlet-name>test</servlet-name>
        <servlet-class>test.Test</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>test</servlet-name>
        <url-pattern>/test</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>
</web-app>
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
  <application>halocline-test</application>
  <version>10</version>

  <!--
    Allows App Engine to send multiple requests to one instance in parallel:
  -->
  <threadsafe>true</threadsafe>

  <!-- Configure java.util.logging -->
  <system-properties>
    <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
  </system-properties>

  <!--
    HTTP Sessions are disabled by default. To enable HTTP sessions specify:

      <sessions-enabled>true</sessions-enabled>

    It's possible to reduce request latency by configuring your application to
    asynchronously write HTTP session data to the datastore:

      <async-session-persistence enabled="true" />

    With this feature enabled, there is a very small chance your app will see
    stale session data. For details, see
    http://code.google.com/appengine/docs/java/config/appconfig.html#Enabling_Sessions
  -->

</appengine-web-app>
在web浏览器中打开localhost:8888时,控制台中不会显示任何错误


知道我做错了什么吗?

您的servlet被映射到
http://localhost:8888/test

我相信您的index.html文件可能位于错误的目录中。检查它是否意外滑入
WEB-INF
下。它应该直接放在
war

下面,非常感谢,这很有效。但是,当我部署此应用程序并访问MyAppID.appspot.com/test时,我收到以下错误:错误:服务器错误服务器遇到错误,无法完成您的请求。如果问题仍然存在,请报告您的问题,并说明此错误消息和导致此问题的查询。请查看appengine上的日志文件。@Jaroslaw Pawlak:请查看管理控制台中的日志文件
Jul 06, 2012 2:42:34 PM com.google.apphosting.utils.jetty.JettyLogger info
INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
Jul 06, 2012 2:42:35 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed C:\Users\Halocline\workspace\Test\war\WEB-INF/appengine-web.xml
Jul 06, 2012 2:42:35 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed C:\Users\Halocline\workspace\Test\war\WEB-INF/web.xml
Jul 06, 2012 3:42:36 PM com.google.appengine.tools.development.DevAppServerImpl start
INFO: The server is running at http://localhost:8888/
Jul 06, 2012 3:42:36 PM com.google.appengine.tools.development.DevAppServerImpl start
INFO: The admin console is running at http://localhost:8888/_ah/admin