Google App Engine-Java:HTML错误403:配置解决方案线程

时间:2013-06-13 03:46:27

标签: java html google-app-engine windows-7

GAE:Java:Windows 7 CONFIG

  

我想尝试在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选项 - >连接 - >局域网设置 - > {checked}“使用代理服务器>服务器用于LAN&& {checked}旁路代理服务器本地地址&&(在ADVANCED-EXCEPTIONS下)在“不使用代理服务器”一节中添加了“localhost”,地址以:   'localhost' (5)尝试通过cmd刷新dns    * Ipconfig / flushdns * nbstat -R * nbstat -RR * netsh int reset all * nets int ip reset * netsh winsock reset

     

我喜欢理解内部工作原理 - 所以这段代码是一个测试GAE配置的骨架,是拨打的&在我上传更多之前工作。根据教程,这似乎很容易。

     

由于我刚接触GAE,我非常感谢有关为什么/如何>的详细信息。不工作/您的建议如何纠正问题。非常感谢GAE技术团队。你摇滚!

     

签名:Tree@iTreeware.com


INDEX.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>

应用服务引擎-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>

&GT;

LOG

  
> 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

  

1 个答案:

答案 0 :(得分: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>
相关问题