Hey Ken,

I'm a bit unclear on your issue, so if you could clarify, it would be 
helpful.

You have a cronJob on the /admin/cron/crontest1 URL that creates a js and 
displays it. When you hit the url yourself, it goes through... but when the 
job autoruns, it fails... right?

If this is the behavior you're experiencing, I'd say it's to be expected... 
how would a scheduled cron job running on the backend display anything?

Let me know if I'm the one not understanding your issue properly here.

Cheers!

On Monday, June 29, 2015 at 12:02:20 AM UTC-4, Ken Bowen wrote:
>
>
> I have a simple test cron job which does not succeed in running on GAE. 
>  The target url runs correctly when invoked from a browser (when I’m logged 
> in as admin),  but cron is not successfully running the job.  The GAE Cron 
> Jobs page shows:
>
>     /admin/cron/crontest1    every 2 hours (America/New_York) 
>     Initial simple test            2015/06/28 23:18:03 2 secs late Failed
>
> Here’s the cron.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <cronentries>
> <cron>
>     <description>Initial simple test</description>
>     <timezone>America/New_York</timezone>
>     <url>/admin/cron/crontest1/</url>
>     <schedule>every 2 hours</schedule>
> </cron>
> </cronentries>
>
> In web.xml, the <url-pattern>/admin/*</url-pattern> gets the   
> <security-constraint>:
> <auth-constraint>
>              <role-name>admin</role-name>
>         </auth-constraint>
>
> The target url /admin/cron/crontest1/ assembles a very simple jsp page 
> equivalent to:
> <head>
>     <script type='text/javascript' 
> src='/admin/cron/crontest1/crontest1.js'></script>
>     <script>
> $(document).ready(function() {
>     crontest1init();
> });
>     </script>
> </head>
> <body> 
> <h1>CronTest1</h1>  
> </body> 
>
> where crontest1.js is just:
>
> function crontest1init()
> {
> AdminIntf.crontest1();
> }
>
> And AdminIntf.crontest1() is just a DWR (Direct Web Remoting) call to this:
>
> public static void crontest1(){
>     final DateTimeFormatter fmt = Constants.YMDHMS_DATETIME_FORMATTER;
>         String now = fmt.print(System.currentTimeMillis());
>         logger.warn("############## crontest1() ############: " + now);
> }
>
> When I am logged in as admin and issue the url
>
> http://[my.project].appspot.com/admin/cron/crontest1/
>
> the result is a page showing
>
> CronTest1
>
> and the logs show:
>
> ……/dwr/call/plaincall/AdminIntf.crontest1.dwr 200 …blah,blah
> I 2015-06-28 21:10:18.026 org.directwebremoting.util.CommonsLoggingOutput 
> info: Exec: AdminIntf.crontest1()
> W 2015-06-28 21:10:18.064 com.strongbrain.admin.AdminIntf crontest1: 
> ############## crontest1() ############: 2015-06-29 03:10:18 UTC
>
> The url action returns 200, but, as noted at top, cron doesn’t 
> successfully run this.  Clearly I’m missing something essential, but I 
> can’t see what.
> Any help will definitely be appreciated.
> Thanks in advance,
> Ken Bowen
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/e49bc100-aeda-475c-94d4-0dc9b3ef94b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to