Railo Tip: CreateObject('java')
I'm actually hesitant to post this because the Railo team is actually trying to make progress on documentation and we have some new documentation policies in place. However, I know if I don't post this and people eventually find out about it, they'll wonder why they didn't know sooner. This tip pertains to Railo's createObject('java') implementation. I'm told that it has been there for awhile, but I couldn't tell you what build it came from. I'll share the code and go from there.
<cfset object = createObject('java','path.to.package.classtoinvoke','/path/to/jar/file/on/system')>
Read that line 2 or 3 times and let it sink in a little. Yes, Railo's createObject('java') has a 3rd (and 4th) argument. This is the full documentation on this from Michael is:
createObject('java',String className,String paths, String delimiter )
- 'java' (required)
- className (required) - the full class name (class and package) of the class to invoke.
- path (optional) - a list of jar files and directory that contains class files
- delimiter (optional) - delimiter used for the path list (default is comma ",")
Sean Corfield will be presenting this to the opemcfml.org advisory board, whether it gets voted on or not remains to be seen. Also, please note that I'm making Documentation/Wiki a high priority for the year 2010.



Thanks for the post, you are *really* anywhere these days :-)
Does specifying this 3rd argument effectively makes a new classloader for that object?
Yes, a java.net.URLClassLoader
Can you say anything about the order in which the requested java object is searched for?
In java Classloaders are organized hierarchical and a class is always searched first in the parent ClassLoader.
Will the path(s) in the 3rd argument be searched before or after the webroot and current directory?
the webroot and the current directory is not searched for jar or class files.