CFSCHEDULE Action=List not working

Lucee 5.2.9.31, Windows 2012 R2 Standard, Apache Tomcat 8.5.35

<cfschedule action="list" result="qryScheduledTasks" />

Returns:

Scope, qryScheduledTasks, Query, Execution Time: 0 ms, Record Count: 0, Cached: No, Lazy: No

Columns:

task path file startdate starttime enddate endtime url port interval timeout username password proxyserver proxyport proxyuser proxypassword resolveurl publish valid paused autoDelete

Lucee admin (web context) shows 17 tasks which were created in Lucee admin.

What am I doing wrong? Do I have to provide an admin password somewhere? If so, how?

Thanks.

Hi Bill. You don’t need an admin password, but Lucee will only return the tasks defined in the current web context. Are you sure you’re executing this in the context where your 17 tasks are defined?

There’s only one website running Lucee, so in the admin module there’s the “Server” (root) context, which doesn’t show/allow scheduled tasks, and the “Web” (website) context that shows the scheduled tasks.

The admin module login shows “Server” or “Web”
Clipboard03

I assume the “Web” context (blue background) login is for the website, and it shows the following scheduled tasks

OK, I’m not quite sure how you’ve got things set up, but to double-check there’s only one web context, does the domain in the Tomcat URL for the web admin containing the tasks match the domain for your site (from where you’re calling <cfschedule>? i.e.:

mywebsite.com:8888/lucee/admin/web.cfm

Another way to check this is to look in the WEB-INF folder below your website’s root, and check the contents of scheduler/scheduler.xml. Can you see your tasks defined there?

Julian, thanks for your help.

Yes, localhost:8888/lucee/admin/web.cfm shows the expected login window and also shows the tasks.

No. I found them in C:\lucee\tomcat\webapps\ROOT\WEB-INF\lucee\scheduler so I guess I don’t know sh… from Shinola when it comes to the Lucee admin interface.

Regardless, I tried switching the XML between the two locations: the admin module still shows the tasks under the “web” context, but <cfschedule> still returns an empty query.

I added a program to C:\lucee\tomcat\webapps\ROOT and <cfschedule> does show the 17 tasks.

My intranet application/website is physically located in Program Files. It’s a virtual directory under the default website.

Is that the issue?

Try restarting Tomcat/Lucee. Changes to the XML aren’t picked up on the fly.

Okay, good idea. After the restart, the Lucee admin interface shows empty, while <cfschedule> from my application shows the tasks.

So it seems that with Lucee, I have to “replace” the scheduled tasks interface with my own code or forget about any programmatic interface to the tasks.

Thanks for your help.

No, you can use the admin UI - but you need to be using the right web admin for the context your site/app is running in.

We’ve established that you have two web contexts: the ROOT application for which the URL is:

http://localhost:8888/lucee/admin/web.cfm

and another separate one for your website/app. As I said earlier you should be able to access this via Tomcat using the host domain you are using for your app, e.g.

http://myappdomain:8888/lucee/admin/web.cfm

Hi Julian and thanks for your perseverance.

Okay, a light is going on…

The app domain is localhost, but if I browse to http://localhost:8888/IntelliPad/lucee/admin/web.cfm I see an empty task list. So this is where I have to set the tasks if I want my application to have access to settings. So the Lucee admin code gets propagated to all the WEB-INF folders.

Thanks again for your assistance.

Sorry, what I said was slightly misleading in that you can indeed have multiple contexts using the same hostname but located in different (virtual) directories.

Glad things are making more sense now anyway.