How to Clear ColdFusion's Class File Cache

Published: {ts '2016-02-02 00:00:00'}
Author: Steven Neiland
Site Url: http://www.neiland.net/article/how-to-clear-coldfusions-class-file-cache/

Yesterday I ran into a strange bug with a legacy cf9 orm application where it could not find a particular bean despite it existing. What was even more peculiar was that the same code was running perfectly on two other servers.

After a couple of hours hacking at the server, restarting it and googling I finally stumbled on the answer. It appears that ColdFusion was hanging onto a bad version of the code class file in its cache and I needed to manually clear its cache.

How to Clear ColdFusion's Class File Cache

When ColdFusion read cfml and cfc files it compiles them into to Java Class files. On some rare occasions you may find you need to clear these cached class files. To do so follow these steps:

  1. Stop the ColdFusion Service
  2. Locate your cfclasses directory at {coldfusion install dir}/wwwroot/WEB-INF/cfclasses
  3. Delete all .class files in this directory
  4. Start the ColdFusion Service

When you start the Service back up you can expect it to take some time to recompile all the files if you have a large codebase so dont be surprised if it takes a while for everything to get back to normal.