Scheduled tasks with localhost in URL not running

Hi there,

I’m having a problem getting Scheduled Tasks to run that have localhost in the URL (Ex: http://localhost:8888/schedule/test.cfm)

If I try to run it I get the following error in the output log file:

/schedule/test.cfm [/opt/lucee/tomcat/webapps/ROOT/schedule/test.cfm] not found

Of course the file does not exist in the location it’s trying to run it from. The file is actually located in the /var/www/html/schedule directory and I have a mapping that’s set as:

/schedule /var/www/html/schedule

If I point my browser to the machine IP to run the task as follows it works:

http://server:8888/schedule/test.cfm

Any ideas what I’m missing here?

Thanks

coz http://server isn’t necessarily the same as http://localhost

only the hostname is important for a context, not the port number (even if they are the same effectively)

what is your webserver setup like?

I’m running Ubuntu 16.04 with Lucee 5.2.9.31. Is there anything in particular you need to know about my setup?

I assume you’re running apache and mod_cfml?

do understand what I meant about the hostname being used to determine the lucee context?

Correct, I’m running apache and mod_cfml as you said. I just didn’t think that Apache has any relevance in this since I’m not hitting Apache in this situation. I was under the impression that I’m simply hitting Tomcat on port 8888. Can you clarify what you mean with the hostname?

Thanks a lot

Hi @deeztek,

I created a schedule task with path related to mapping creation. Everything works fine for me. I’ve checked with Windows 10, Lucee 5.3 latest & also 5.2.9.31.

Create Mapping by:

Virtual: /Mytask

Resource: File path (Ex:D:\testTask\Files)

Create Schedule task:

Name: TaskTest

Url:http://localhost:8888/myTask/test.cfm

in your original post you are using two different hostnames, localhost and server

each hostname generates a web context (ports are ignored)

it doesn’t matter if they resolve to the same ip and port, it’s the hostname which is used to configure the request

I understand, so how do I go about figuring out what the problem is? When I try to request the resource from the server itself, it doesn’t work. localhost resolves to 127.0.0.1 and when I try the request from another machine to the server it works using the server name which resolves to the IP of the box.

HI cfmitrah, that’s how I have the server setup. I have a mapping in the Web Administrator pointing to the resource and I have the scheduled task as you described but it doesn’t seem to work. Am I missing something?

so, just use the server name for the scheduled task?

localhost resolves to the default lucee web context (i.e. /opt/lucee/tomcat/webapps/ROOT/)

Maybe I wasn’t clear. When I put in there “server”, I didn’t actually mean the actual server name. If I simply put in the IP address of the server in the web browser it works fine. So using localhost i.e. 127.0.0.1 it should also work yes?

What you are saying makes sense, however I have another server with the exact same setup and using localhost doesn’t try to go to the default lucee web context, it actually goes to the virtual mapping I setup which points to the /var/www/html/schedule directory. I thought configuring the mappings would take care of the issue. So I must be doing something wrong…