02 October 2007 01:01 PM
Javaloader v0.5 Released
Here is the release of JavaLoader, version 0.5.It pretty much does exactly the same thing that the previous versions did, however, it now works in ColdFusion 8, when the setting 'Disable access to internal ColdFusion Java components' is turned on, as it uses its own JavaProxy CFC, which may often be turned on on shared hosts.
That's really about it, nothing more interesting than that.
Download JavaLoader v0.5 from here.






Comments
Posted by Imara on 08 October 2007 11:51 PM
it is a must
Posted by Aaron on 28 November 2007 03:01 AM
Hi there, this looks like a useful utility. To completely isolate Java code loaded via the NetworkClassloader, I would suggest considering investigating changing the lookup algorithm in NetworkClassloader so that it looks first at itself before delegating to the parent. This would allow using versions of jars that might conflict with the core CF libraries (we have run into this with Axis jars). Along with this you may want to set the Thread contextClassLoader for each call, so any loaded framework code itself will use the correct classloader. This can probably be done by simply setting the context classloader to the networkclassloader in the JavaProxy prior to each invocation, and resetting/unsetting it afterwards. Going through a wrapper like JavaProxy is handy in this way.
Posted by Freddy on 30 January 2008 10:50 PM
I am having problems forcing the javaloader to use a different version of iText than the one in the cf libraries. Is there any way to force the loader to not use the version in the cf lib?
Posted by Mark on 31 January 2008 04:40 AM
@Freddy just tell JavaLoader to load up without the CF classpath (which it does by default), and then you have your separation.
Posted by freddy on 31 January 2008 05:54 PM
That is how I am calling it. However when I use
loadPaths = ArrayNew(1);
loadPaths[1] = ExpandPath("itext-2.0.4.jar");
loader = createObject("component", "javaloader.JavaLoader").init(loadPaths);
document = loader.create("com.lowagie.text.Document").init();
WriteOutput("iText Version from loader = "& document.getVersion() & "<br><br>");
document.close();
document = createObject("java","com.lowagie.text.Document").init();
WriteOutput("iText Version normal = "& document.getVersion()& "<br><br
document.close();
It gave me the following result:
iText Version from loader = iText by lowagie.com (r1.02b;p128)
iText Version normal = iText by lowagie.com (r1.02b;p128)
This is on cf7 and it is possible that the class path information is non-standard in these installs. On cf8 on my dev server the javaloader worked as advertised.
Thanks
Posted by Mark on 01 February 2008 04:35 AM
@Freddy, you should you are using JavaLoader 0.5?
Posted by freddy on 01 February 2008 08:00 PM
I am using the 0.5 version