【问题标题】:Google App Engine-Java: HTML Error 403: Configuration Solution ThreadGoogle App Engine-Java:HTML 错误 403:配置解决方案线程
【发布时间】:2013-06-18 02:15:43
【问题描述】:

GAE:Java:Windows 7 配置

我正在尝试在 Windows7/Java 下的 GAE 上测试一个基本的 HTML“Hello World”,然后再开始做一些更有趣的事情。但是,粘贴时 http://localhost:8888 进入 Chrome 或 IE => throws 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 刷新 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>

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

【问题讨论】:

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


    【解决方案1】:

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

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

    您还可以通过将其位置映射为您的web.xml 中的welcome file,使应用程序更容易找到它。您可以通过在web-app 标签中包含以下代码来做到这一点:

        <welcome-file-list>
            <welcome-file>index.html</welcome-file>
        </welcome-file-list>
    

    【讨论】:

    • 非常感谢。我将我的 index.html 移到了 war 文件夹,并按预期执行。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多