Cron作业失败,错误代码为302

时间:2022-12-21 15:38:53

I am trying to create a cron job in GAE using java but it is failing with below error message.

我正在尝试使用java在GAE中创建一个cron作业,但它失败了以下错误消息。

2013-07-22 18:46:13.336 /cron/addCount/1 302 184ms 0kb AppEngine-Google; (+http://code.google.com/appengine)
0.1.0.1 - - [22/Jul/2013:18:46:13 -0700] "GET /cron/addCount/1 HTTP/1.1" 302 148 - "AppEngine-Google; (+http://code.google.com/appengine)" "nfactsocial.appspot.com" ms=184 cpu_ms=86 cpm_usd=0.000017 queue_name=__cron task_name=00bb386ed1578e2c78a432e9debd4ca2 app_engine_release=1.8.2 instance=00c61b117c969fb7897a43da0d38d5b3b68029

Below is my cron.xml file :

下面是我的cron.xml文件:

<cronentries>
  <cron>
    <url>/cron/addCount/1</url>
    <description>Add count + 1 every 1 minutes</description>
    <schedule>every 1 minutes</schedule>
  </cron>
</cronentries>

I haven't use any admin related securities but still it is failing. Can anyone please help ?

我没有使用任何管理相关的证券,但它仍然失败。有人可以帮忙吗?

-Thanks

2 个解决方案

#1


0  

Is there any more error text? The log shows the HTTP status code 302 which means the hit is being redirected. It appears to be redirecting the cron script to the login page at "/".

还有错误文字吗?日志显示HTTP状态代码302,这意味着正在重定向命中。它似乎是将cron脚本重定向到“/”处的登录页面。

#2


0  

Maybe you have any filter active for the root, so the first the app is doing is trying to validate this filter. I had the same problema as you, and finally it was the filter applied to root who was redirecting me before the cron action.

也许你有任何过滤器活动过滤器,所以应用程序正在尝试验证此过滤器。我和你有同样的问题,最后是应用于root的过滤器,它在cron动作之前重定向我。

#1


0  

Is there any more error text? The log shows the HTTP status code 302 which means the hit is being redirected. It appears to be redirecting the cron script to the login page at "/".

还有错误文字吗?日志显示HTTP状态代码302,这意味着正在重定向命中。它似乎是将cron脚本重定向到“/”处的登录页面。

#2


0  

Maybe you have any filter active for the root, so the first the app is doing is trying to validate this filter. I had the same problema as you, and finally it was the filter applied to root who was redirecting me before the cron action.

也许你有任何过滤器活动过滤器,所以应用程序正在尝试验证此过滤器。我和你有同样的问题,最后是应用于root的过滤器,它在cron动作之前重定向我。