How to Clear ColdFusion's Class File Cache

Author: Steven Neiland
Published:

Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.

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.

Reader Comments

  • Please keep comments on-topic.
  • Please do not post unrelated questions or large chunks of code.
  • Please do not engage in flaming/abusive behaviour.
  • Comments that contain advertisments or appear to be created for the purpose of link building, will not be published.

Archives Blog Listing