GAE-使用cron计划任务(java)时无法上传cron.xml,500错误

错误信息

com.google.appengine.tools.admin.AdminException: Unable to update app: Error posting to URL: https://appengine.google.com/api/datastore/cron/update?app_id=fatkuns&version=4&
500 Internal Server Error Server Error (500)
A server error has occurred. at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:62) at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java:271) at com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java:145) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Caused by: java.io.IOException: Error posting to URL: https://appengine.google.com/api/datastore/cron/update?app_id=fatkuns&version=4&
500 Internal Server Error Server Error (500)
A server error has occurred. at com.google.appengine.tools.admin.ServerConnection.send(ServerConnection.java:149) at com.google.appengine.tools.admin.ServerConnection.post(ServerConnection.java:82) at com.google.appengine.tools.admin.AppVersionUpload.send(AppVersionUpload.java:559) at com.google.appengine.tools.admin.AppVersionUpload.updateCron(AppVersionUpload.java:260) at com.google.appengine.tools.admin.AppVersionUpload.doUpload(AppVersionUpload.java:133) at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:56) … 4 more

原因:

cron.xml文件书写不正确 记得Asia/Shanghai这个是必须写的,不然无法上传,官方的例子居然有一个没写

/cron 描述 every 2 minutes Asia/Shanghai
/cron
描述
every 2 minutes
Asia/Shanghai
**更新:**发现如果 url填写错误也会上传失败,正确的方式是写“/xxxx”这样的路径,不能写全路径..
updatedupdated2024-11-302024-11-30