0

GAE:Java:Windows 7 配置

我正在尝试在 Windows7/Java 下的 GAE 上测试一个基本的 HTML“Hello World”,然后再开始做一些更有趣的事情。但是,当粘贴 http://localhost:8888到 Chrome 或 IE 中时 => 抛出 ERROR 403`

. 我已经搜索了几天发布的可行解决方案

我想让它成为许多 Google App Engine-Java 编码器的解决方案线程

以下是其他线程的一些推荐解决方案:尝试过,但没有解决我的错误 403。

(1)禁用我的防火墙/病毒防护/降低安全性
(2)通过 cmd 以管理员身份运行 ping "localhost" (3)修改 c:\windows\system32\drivers\etc\hosts 文件以删除 "::1" (4)代理设置修改(IE Options->connections->lan settings->{checked}"use proxy > server for LAN && {checked}绕过代理服务器获取本地地址&&(在ADVANCED-EXCEPTIONS}下添加了"localhost" “不要对以下开头的地址使用代理服务器”部分: 'localhost' (5)尝试通过 cmd * Ipconfig /flushdns *nbstat –R *nbstat –RR *netsh int reset all * nets int ip reset * netsh winsock reset 刷新 dns

我喜欢了解内部工作 - 所以这段代码是一个框架,用于测试 GAE 配置是否已拨入并在我上传更多内容之前工作。根据教程,这似乎很容易。

由于我是与 GAE 合作的新手,我将非常感谢有关它为什么/如何 > 不起作用/您的建议如何纠正问题的详细信息。非常感谢 GAE 技术团队。你摇滚!

签名:Tree@iTreeware.com


索引.HTML

> <!DOCTYPE html>
> <html>
>  <body> <p> Hello World from TREEware! </br> 403 Error B Gone!</p> 
>  </body>
>  </html>
> 

WEB.XML

> <?xml version="1.0" encoding="utf-8"?>
> <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">
>  
> </web-app>

APPENGINE-WEB.XML

> <?xml version="1.0" encoding="utf-8"?>
> <appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
>   <application>itreeware1</application>
>  <version>1</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>

>

日志


> Jun 12, 2013 8:26:39 PM com.google.apphosting.utils.config.AppEngineWebXmlReader 
> readAppEngineWebXml
> INFO: Successfully processed C:\Users\Organize4Joy\workspace\TreeApp1\war\WEB-\
> INF/appengine-web.xml
> Jun 12, 2013 8:26:39 PM com.google.apphosting.utils.config.AbstractConfigXmlReader 
> readConfigXml
> INFO: Successfully processed C:\Users\Organize4Joy\workspace\TreeApp1\war\WEB-INF/web.xml
> Jun 12, 2013 8:26:39 PM com.google.appengine.tools.development.SystemPropertiesManager 
> setSystemProperties
> INFO: Overwriting system property key 'java.util.logging.config.file', value 'C:\Program > Files\Google\appengine-java-sdk-1.8.1\config\sdk\logging.properties' with value 'WEB-
> INF/logging.properties' from 'C:\Users\Organize4Joy\workspace\TreeApp1\war\WEB-
> INF\appengine-web.xml'
> Jun 12, 2013 8:26:39 PM com.google.apphosting.utils.jetty.JettyLogger info
> INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
> Jun 13, 2013 1:26:40 AM com.google.apphosting.utils.jetty.JettyLogger info
> INFO: jetty-6.1.x
> Jun 13, 2013 1:26:42 AM com.google.apphosting.utils.jetty.JettyLogger info
> INFO: Started SelectChannelConnector@127.0.0.1:8888
> Jun 13, 2013 1:26:42 AM com.google.appengine.tools.development.AbstractServer startup
> INFO: Server default is running at http://localhost:8888/
> Jun 13, 2013 1:26:42 AM com.google.appengine.tools.development.AbstractServer startup
> INFO: The admin console is running at http://localhost:8888/_ah/admin
> Jun 12, 2013 8:26:42 PM com.google.appengine.tools.development.DevAppServerImpl start
> INFO: Dev App Server is now running
> Jun 12, 2013 8:27:02 PM com.google.appengine.tools.development.LocalResourceFileServlet 
> doGet
> WARNING: No file found for: /favicon.ico
> Jun 12, 2013 8:27:02 PM com.google.appengine.tools.development.LocalResourceFileServlet 
> doGet
> WARNING: No file found for: /favicon.ico

4

1 回答 1

1

此处放错位置的文件有时也会引发 403。

确保您的HTML页面在war文件夹中而不是WEB-INF,否则可能找不到。您可能期望这会导致 404,但在这种情况下,也期望 403。

您还可以通过将其位置映射为welcome file您的web.xml. 您可以通过在标签中包含以下代码来做到这一点web-app

    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>
于 2013-06-17T18:15:43.577 回答