Cached class files throwing error when overwriting/updating source files

Over the weekend I uploaded a bunch of changes to my old CF site via FTP and the main index.cfm (but no other files) started throwing an error. It was very disconcerting because I couldn’t get rid of it by clearing template caches, restarting Lucee (from Windows or the admin), or even rebooting the server. I tried clearing all of the caches from the admin at the server and site level as well as setting “Inspect Templates” to “Always ( Bad )”.

Eventually, I moved the “site directory” from the website_directory/WEB-INF/lucee/cfclasses directory, causing it to be re-created, and then everything just worked. I just wanted to report this because I don’t think this should happen. Is there a best practice for deploying updates? Should I stop my server? I’ve never had to in the past and never run into this.

Windows Server 2019 (10.0) 64bit
Apache 2.4.57
Apache Tomcat/9.0.78

Lucee Error (
Message C:\websites[mysite]\website\WEB-INF\lucee\cfclasses\CFC__websites_[mysite]_website7287\index_cfm$cf.class (Access is denied)

Lucee Error (
Message C:\websites[mysite]\website\WEB-INF\lucee\cfclasses\CFC__websites_[mysite]website7287\index_cfm$cf.class (Access is denied)
Java Stacktrace lucee.runtime.exp.NativeException: C:\websites[mysite]\website\WEB-INF\lucee\cfclasses\CFC__websites
[mysite]_website7287\index_cfm$cf.class (Access is denied)
at java.base/ Method)
at java.base/ Source)
at java.base/ Source)
at lucee.runtime.compiler.CFMLCompilerImpl._compile(
at lucee.runtime.compiler.CFMLCompilerImpl.compile(
at lucee.runtime.PageSourceImpl._compile(
at lucee.runtime.PageSourceImpl.compile(
at lucee.runtime.PageSourceImpl.loadPhysical(
at lucee.runtime.PageSourceImpl.loadPageThrowTemplateException(
at lucee.runtime.PageSourceImpl.loadPage(
at lucee.runtime.PageContextImpl._doInclude(
at lucee.runtime.PageContextImpl._doInclude(
at lucee.runtime.listener.ClassicAppListener._onRequest(
at lucee.runtime.listener.MixedAppListener.onRequest(
at lucee.runtime.PageContextImpl.execute(
at lucee.runtime.PageContextImpl._execute(
at lucee.runtime.PageContextImpl.executeCFML(
at lucee.runtime.engine.Request.exe(
at lucee.runtime.engine.CFMLEngineImpl.service(
at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(
at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(
at lucee.loader.servlet.CFMLServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.tomcat.websocket.server.WsFilter.doFilter(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.ajp.AjpProcessor.service(
at org.apache.coyote.AbstractProcessorLight.process(
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(
at org.apache.tomcat.util.threads.ThreadPoolExecutor$
at org.apache.tomcat.util.threads.TaskThread$
at java.base/ Source)
Caused by: C:\websites[mysite]\website\WEB-INF\lucee\cfclasses\CFC__websites
[mysite]_website7287\index_cfm$cf.class (Access is denied)
… 47 more

Timestamp 9/9/23 3:21:11 PM EDT

The hint is in the error:
Lucee Error (
Message C:\websites[mysite]\website\WEB-INF\lucee\cfclasses\CFC__websites_[mysite]website7287\index_cfm$cf.class (Access is denied)

Looks like for some reason lucee can’t overwrite the file because of permissions. Check what user lucee is running under and the permissions you have in the WEB-INF folder.

Yeah, but it’s not “just” a permissions issue because all the other files updated just fine. I could navigate directly to interior pages that were updated and they worked. It seems like an intermittent issue related to file locking. What role/permissions are expected?

you’ve gone and enabled check the file very time and you are updating the files on a server under load

if anything, firstly revert to once, always is never a good idea.

I’d suggest as long as your going to try and deploy to a live server, rather than going full modern blue/green deploying, is actually switching to never, as all prod server ought to be, and then calling inspectTemplates() within your application (alas inspectTemplates in 5.x is per application) after you ftp the changed files up, to tell Lucee to flag all the templates as possibly dirty and to check for modifications.

The access denied is probably coz your ftp client has locked the file to update it

Oh, I don’t think I am clear on how this works, and need to read up. But if I switched to “never” and this prevented the file locking issue, I should be able to manually clear the template cache in Lucee admin to refresh them as well, right?

alas no, as because as I mentioned, that function alas only works for per application

inspectTemplates() is super light weight which just checks for changes once, the alternative is pagePoolClear() which blows away the whole cache

I’m only updating 1 application at a time, so not sure why this would matter if I’m doing it within that apps’ admin interface (I wasn’t clear on that). I appreciate your reply and insight, just trying to get my head around the details. I’ll check out inspectTemplates and how I can leverage that.

I updated “Inspect Templates” to “never” and dropped a trigger for InspectTemplates() into my admin area and it works like a charm! Thanks for the info.


great! thanks for reporting back!