Dynamic Java Class Loading with ColdFusion
Doug Hughes has posted a very clever technique for allowing you to run Java classes without adding them to your classpath. This means that people who build ColdFusion apps that include java classes can make them super easy to install.
- Getting Size of Heap and Non Heap Memory in CFML - July 17, 2013
- Adobe Says Go Ahead and Upgrade your ColdFusion JVM - October 24, 2012
- HashDOS and ColdFusion - December 30, 2011
- Using AntiSamy with ColdFusion - August 5, 2010
- OutOfMemoryError - GC overhead limit exceeded - March 25, 2010
It's at least as simple (I'd say simpler) to include the compiled classes on the filesystem in the same directory as your CF files, and use a URLClassLoader to load them. Still no need for access to the classpath, it's just as easy to install the app, and no messing with having to encode your classes and all that rot (which makes building a lot easier).
Barney, I don't disagree with you at all. But, consider my business: selling easy-to-use-but-still-somehow-powerful components to developers of all skill levels. I know, without a doubt, that you and Pete could easily handle moving some class files arround. I can't say that for everyone else. (I speak from experiance.) Besides, there's the "how'd they do that?!?" effect. Oh, and if you implement all your code in Java, but create a CF facade and imbed your java classes inside that CFC, you can prevent decompiling... sorta. :) Anyhow, I'm not saying we should use it. I'm just saying it works. Doug
- Docker Container exited with code 137
- Why is my cron.daily script not running?
- Announcing FuseGuard Version 3
- CFSummit 2017
- Java Unlimited Strength Crypto Policy for Java 9 or 1.8.0_151
- Java 9 Security Enhancements
- Upcoming CFML Conferences in April 2017
- CFSummit 2016 Slides