4
votes

Background

From ColdFusion 10 onward it is possible to include JARs from a custom location.

To load custom Java libraries (or .java files) code similar to the following is added to Application.cfc

this.javaSettings = {LoadPaths = [".\java_lib\",".\java\myjar.jar"],
      loadColdFusionClassPath = true, reloadOnChange = false}

Or to pickup changes (with a default 60 second refresh time) the following is added

this.javaSettings = {LoadPaths = [".\java_lib\",".\java\myjar.jar"], 
         loadColdFusionClassPath = true, reloadOnChange = true}

Question

For development the second option is good (probably with a much lower refresh time). For production the first option would be ideal, but restarting the server every time we need to change any java code is not acceptable. Is there any way to trigger a reload of java classes (preferably programmatic) without restarting the server when reloadOnChange = false is set?

1
restarting the server every time we need to change any java code I am not 100% positive, but ... IIRC it should only require restarting the application, not the whole server. Did you try it? (I realize that is not as granular as you are looking for, but AFAIK CF does not expose any methods for reloading on demand.) - Leigh

1 Answers