• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Coldfusion 11 Scheduled Task Event Handler

New Here ,
Feb 14, 2015 Feb 14, 2015

Copy link to clipboard

Copied

Hello,

I have a coldfusion 11 install on a windows server.

I am trying to create a scheduled task with an eventhandler.

Here is the error I am receiving:

  • An error occured scheduling the task.
    Invalid eventhandler.
    Error: Eventhandler taskalert could not be found.

The event handler cfc is located here:

C:\ColdFusion11\cfusion\wwwroot\taskalert.cfc

In the box on the scheduled task I just entered taskalert because I dropped the cfc in the base directory.

The directions say:

Everything I read shows that the webroot default is C:\ColdFusion11\cfusion\wwwroot

but it doesn't seem to work.

The CFC contains code found here: http://help.adobe.com/en_US/ColdFusion/10.0/Developing/WSe61e35da8d31851899e53a51353e870493-8000.htm...

but I changed it to my email address

Any ideas what I am missing?

Thanks!

Randy

Views

2.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 27, 2015 Feb 27, 2015

Copy link to clipboard

Copied

Anyone have any advice?  Seems like it should be straight forward....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 15, 2015 May 15, 2015

Copy link to clipboard

Copied

I am having the same issue and would like to see the answer if someone knows that the issue it. Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 12, 2016 Feb 12, 2016

Copy link to clipboard

Copied

Same issue here - any solution?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

I am having this exact problem. Have you ever found a fix for this?

In my case, the code, path, everything worked flawlessly on Coldfusion 10 on Windows 7 (32-bt), but when I got a new Windows 7 (64-bit) laptop and installed ColdFusion 11, I get the exact same error you posted. I have googled every single phrase I can think of to find help for this problem. Your post is the only one I found that is even close, and has no answer. It looks as if I will have to abandon the idea of having an eventhandler for my CFSCHEDULE tag.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 14, 2017 Aug 14, 2017

Copy link to clipboard

Copied

LATEST

Hi all,

We had the same issue and with the help of Adobe support here's what we did to make it work.  First, your event handler (eventlistener.cfc) must be written correctly otherwise you will receive the above error:

  • An error occured scheduling the task.
    Invalid eventhandler.
    Error: Eventhandler taskalert could not be found.

The .cfc should follow the template below:

<cfcomponent implements="CFIDE.scheduler.ITaskEventHandler">

    <cffunction name="onTaskStart" returntype="boolean">  <!--- Adobe Change, Here I Changed the returntype to Boolean--->

        <cfargument name="context" type="struct" >

        <cfreturn true>

    </cffunction>

    <cffunction name="onTaskEnd" access="public" returntype="void">

        <cfargument name="context" type="struct" required="false"/>

    </cffunction>

   <cffunction name="onMisfire" access="public" returntype="void">

        <cfargument name="context" type="struct" required="false"/>

    </cffunction>

    <cffunction name="onError" access="public" returntype="void">

        <cfargument name="context" type="struct" required="false"/>

    </cffunction>

    <cffunction name="execute" access="public" returntype="void">

        <cfargument name="context" type="struct" >  <!--- Adobe Change,This is the argument which I added--->

    </cffunction>

</cfcomponent>

The other important component is to place this eventlistener.cfc in the webroot or in our case we setup a mapping with a logical path to our prefer directory path, so our Event Handler path looked like this:

scheduledtasksroot.eventlistener

On a side note, another successfully work around was to directly manipulate the neo-cron.xml file found in the /cf11/cfusion/lib folder and restarting the server for it to take effect.  I hope this helps the next person, because we spent a good deal of time dealing with this issue.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation