Issue

If you are having trouble running a scheduled task orcfhttp in ColdFusion MX, this TechNote provides tips for troubleshooting the problem. The underlying call for a scheduled task is a cfhttp call, so if you can call the URL through cfhttp, the scheduled task should work.

The standard error seen when running a scheduled task from the ColdFusion MX Administrator that fails is:

There was an error running your scheduled task. Reasons for which scheduled tasks might fail include:  --The URL is a redirection URL.  --The URL is protected by IIS NT Challenge/Response or Apache   .htaccess password. The Username and Password text fields for   editing a scheduled task are intended to support Basic   Authentication only. --The Domain Name lookup failed. Try using the IP address of the   domain whenever possible.  --The URL is an SSL site, but the SSL port was specified incorrectly.  --The Web site is not responding.  --The directory specified for published results does not exist.

If you have reviewed all the reasons listed in the error message above and ruled them out and you are able to successfully browse the URL of the page in a browser (Internet Explorer or FireFox, for example), then try the suggestions below to further troubleshoot the issue.

Solution

Build a sample CFM page to test the URL with thecfhttp tag and then dump the return object. This may give you a better error message and indicate why the scheduled task is failing.

For example:

<cfhttp method="Get" url="http://www.yahoo.com"><cfdump var="#cfhttp#">

If this is an SSL enabled site, in addition to running the code above, enable the SSL debugging options for the JVM. Add the-Djavax.net.debug=all switch to the JVM arguments section of the Java and JVM section of the ColdFusion Administrator or add the switch directly to the jvm.config file and restart ColdFusion.

This will output all the activities involving SSL within the JVM to the main out log (for example, default-out.log for ColdFusion MX 6 and coldfusion-out.log for ColdFusion MX 7). It will list the certificate the site is looking for, all the trusted certs in the keystore, and the SSL communication or handshake. See Sun's website for more details about reading the SSL debugging output.

Additional Information

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy