问题
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:
I would suggest using this instead:
https://github.com/markmandel/JavaLoader
来源:https://stackoverflow.com/questions/29600251/programmatic-reloading-of-java-jars-without-restarting-coldfusion