views:

110

answers:

2

Hello All,

So i have a java class that i want to call from a coldfusion page. The only problem is that my java class requires a newer version on log4j than what is currently used with coldfusion (mx 7). Is there a way i can get my class to only use the one i provide? or can i maybe temporarily load the newer log4j while i call my class file?

Thanks

+2  A: 

look into mark mandel's javaloader

Antony
Unfortunely, that won't do it. even though i load the new version of the file, it still tries using CF version first.is there maybe a way to do the opposite? can i unload a jar file?
hang on - are you trying to use log4j from a coldfusion page, or from a java class being called from a coldfusion page?
Antony
@Limey - I assume you are using the javaLoader to load both your custom jar and log4j? In which case, try adding the jvm setting -Dlog4j.ignoreTCL=true. That should allow the custom class to use the newer version via the JavaLoader. Though I do not know if changing the setting has any adverse effects on CF (since it uses log4j internally).
Leigh
A: 

You can also add the newer log4j jar to the front of the java.class.path in CF's jvm.config, then both CF and the java classes you call will use that instead of the included version. It would have to be in front, though.

David Lakein