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 google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
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/87dee568-8d13-4700-9418-a38755f4a086%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to