0

https://developers.google.com/appengine/docs/java/tools/remoteapi上的 Java 远程 API 介绍运行良好,但我只收到 404 错误:

Exception in thread "main" java.io.IOException: can't get appId from remote api; status code = 404, body: 
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>404 Not Found</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Not Found</h1>
<h2>The requested URL <code>/remote_api</code> was not found on this server.</h2>
<h2></h2>
</body></html>

我相信这是因为服务器配置不正确。“在服务器上配置远程 API”部分中的说明对我来说太模糊了——初学者。'将以下内容添加到您的 web.xml' 语句是问题所在。我不确定该语句指的是哪个 web.xml。将 web.xml 放在各种明显的地方,例如 war/WEB-INF/web.xml 似乎没有帮助。还尝试将其作为动态 Web 项目(在 Eclipse 中)使用 WebContent/WEB-INF/web.xml 中的 xml 代码,这也无济于事。

看起来像是对使用 Remote API 但看不到前进方向的 Java 项目结构的基本误解。建议将不胜感激。

4

1 回答 1

0

在这种情况下,它是一个单模块应用程序,web.xml文件直接位于目录war/WEB-INF中。

您可以按照本教程为 Google App Engine 构建一个完整的示例应用程序。

Google Plugin for Eclipse也会为您创建一个类似的示例应用程序。

于 2014-11-20T14:32:12.817 回答