rss
twitter
    Find out what I'm doing, Follow Me :)

Mac OS X + CF 8 + Multi-server install + ImageGetBlob() == FAIL

I have been fighting an issue with ImageGetBlob().  I am trying to run some very simple code:

<cfimage action="read" name="img" source="#expandPath("zoid.jpg")#"  />
<cfset moo = ImageGetBlob(img) >

When I run this on my dev macine, which is running Mac OS X with ColdFusion 8 installed as 'multi-server', I get a JRun 500 error, the first few lines of which are:

ROOT CAUSE:
java.lang.NoClassDefFoundError
at coldfusion.image.Image.getImageBytes(Image.java:519)
at coldfusion.runtime.CFPage.ImageGetBLOB(CFPage.java:5642)

There have been 2 other people who are running ColdFusion under similar operating system/server install configurations that get the same error.  I have also asked someone running ColdFusion 8 as a 'stand alone' on a Mac and the code works as expected.  The code also works as expected on Windows XP running ColdFusion 8 as a 'multi-server install.

Has anyone else seen this problem?  If you are running ColdFusion on a Mac, either as a 'stand alone' or 'multi-server', would you mind giving the code above a try (obviously changing the image path) and reply back to say if you were successful or not and what your set up is?

Thanx in advance!

 

11 comments

(Comment Moderation is enabled. Your comment will not appear until approved.)
Ciqala Burt said...
I get the same issue on a fresh install

details from my CF admin info page...

OS: OS X 10.5.4

CF: 9,0,1,195765
edition: developer

Java version: 1.5.0_13

Java VM version: 1.5.0_13-119

from the error (can't paste as this is another machine and it's too long to type out :) ) it appears that the com.sun.media.jai.util package is sealed and as such may be conflicting with another instance of the same class somewhere on the classpath.
Ciqala Burt said...
have done a little digging and this appears to be experienced by people using java 1.6.0_06 and it's confirmed in the last entry as a java issue with sealing.

http://forums.sun.com/thread.jspa?threadID=5293731...

perhaps an update beyond java 6 updater 6 will rectify it.
Nathan Mische said...
I'm seeing the same thing with CF 8 mulit-server on Leopard.
dc said...
Confirmed this behaviour on a supported config for Mac OSX x64. (Note that this works on Win 2003 x64)
Scott Stroz said...
Thanx to Elliot Sphren, I was able to get this fixed. Here is the snippet of his e-mail:

'I replicated the issue on my system, and it appears that problem is that Apple ships the JAI with their own native library which is version 1.1.2 which exists in /System/Library/Java/Extensions.

Adobe ships JAI 1.1.3 which is inside the CF's library path.

Unfortunately this creates the conflict and the exception you saw.

To fix it add the following to you to java.args in the jvm.config for JRun:

-Djava.ext.dirs=/Library/Java/Extensions:/System/Library/Frameworks/JavaVM.framework/Home/lib/ext'

2 things:

1. Make sure you backup jvm.config before making any changes.
2. Restart CF after making thsi change.
Tony Garcia said...
I was having this exact problem using ImagePaste(). Thanks for the fix!
Sam Farmer said...
Scott: You da man

Elliot: You da man too

Thanks for the fix
Jared Rypka-Hauer said...
What Elliot said. I just had this problem the other day... I just removed the JAI jar files from the web-inf/cfusion folder. My approach was this because when you install standalone it doesn't install the JAI files, instead allowing the Apple-provided jars to take over. I realize this means dropping back from 1.1.3 to 1.1.2, but I figure if CF wants to do it this way I may as well do it that way myself.

That said, I'd like to know the rationale behind Elliot's fix...
Mike Causer said...
Brilliant!
This fixed all of my JAI conflicts.
My iMac and I both thank you.
Edward Smith said...
I know this is an old post, but I've been hitting this issue myself.

I had solved it by following Elliot's advice, but it had a side-effect of crapping out SSL LDAP. By doing this, I think you're removing critical libraries for encryption.

Jared asked what the rationale is - if you compare the "Java Ext Dirs" in CF Administrator with Elliot's fix in place, and with it removed, you'll see a couple of directories missing with Elliot's fix.

One of these dirs, /System/Library/Java/Extensions, contains JAI jars (jai_core and jai_codec).

I've found that if you remove those two jars from this directory, this image (well, my image issue was slightly different, but very likely stemmed from the same root cause) problem will be resolved, without crapping out SSL.

I do NOT know what effect this might have on any other java programs that may or may not expect JAI to be in that directory.

I'm trying to think of another way to do this that would not have an effect on the OS as a whole.
Elliott Sprehn said...
@Edward

Messing with the /System/Library/Java/Extensions directory, or really anything under /System is a bad idea. That's the reason I chose a fix that only effected CF.

Removing those two libraries will likely break pretty much every Java application that uses ImageIO that assumed the existence of the provided libraries from Apple. I have a feeling that includes a bunch of browser Applets.

Instead copy what you need from /System/Library/Java/Extensions into the CF folder and then use the fix I was talking about. Or go Jared's route and just nuke the CF jars, but that will break certain CF image features unfortunately. I can't remember which ones, but that was the reason I didn't do it that way.

Looking in that folder I can't imagine what relates to SSL LDAP though. It's all AppleScript and graphics related.