上传数据给出错误,android谷歌应用引擎

时间:2014-06-13 17:13:33

标签: android google-app-engine

我已成功将我的Android应用程序部署到Google应用引擎。但每当我想上传任何数据时,它都会出现错误“错误404”。当我在本地运行应用程序时,它工作得很好。请帮我解决一下。我跟踪部署应用程序here

的链接
09:50 PM Uploading data records.
[INFO    ] Logging to bulkloader-log-20140613.215041
[INFO    ] Throttling transfers:
[INFO    ] Bandwidth: 250000 bytes/second
[INFO    ] HTTP connections: 8/second
[INFO    ] Entities inserted/fetched/modified: 20/second
[INFO    ] Batch Size: 10
Error 404: --- begin server output ---

<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?rtok=467081325769</code> was not found o
n this server.</h2>
<h2></h2>
</body></html>
--- end server output ---
抱歉,无法发布图片需要至少10分,所以粘贴了控制台文字。感谢

这是我的appengine-web.xml

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

所以我在Web.xml文件中定义了handeler,现在它正常工作。

<servlet>
<display-name>Remote API Servlet</display-name>
<servlet-name>RemoteApiServlet</servlet-name>
<servlet-class>com.google.apphosting.utils.remoteapi.RemoteApiServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>RemoteApiServlet</servlet-name>
<url-pattern>/remote_api</url-pattern>
</servlet-mapping>
 <servlet>
  <servlet-name>SystemServiceServlet</servlet-name>
  <servlet-class>com.google.api.server.spi.SystemServiceServlet</servlet-class>
  <init-param>
   <param-name>services</param-name>
   <param-     value>com.google.samplesolutions.mobileassistant.CheckInEndpoint,com.google.samplesolutions .mobileassistant.DeviceInfoEndpoint,com.google.samplesolutions.mobileassistant.MessageEndpoint</param-value>
  </init-param>
 </servlet>
 <servlet-mapping>
  <servlet-name>SystemServiceServlet</servlet-name>
  <url-pattern>/_ah/spi/*</url-pattern>
 </servlet-mapping>

1 个答案:

答案 0 :(得分:0)

您需要在appengine-web.xml中使用remote_api url处理程序,或使用app.yaml执行相同操作。