• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

JAI (Java Advanced Imaging) and CF8

New Here ,
Oct 01, 2007 Oct 01, 2007

Copy link to clipboard

Copied

Hi

I'm using the Java Advanced Imaging API since CF6 and made several jar files to manipulate images (as it wasn't integrated in CF).
Today I installed CF8, put the "jai_core.jar" and "jai_codec.jar" in the "cfroot\runtime\jre\lib\ext" folder as I did when I first developped my application or when I migrated from CF6 to CF7 but today it does not work.

I have the following error (see attached), ImageInfo and GetTaille are my own jar classe and method.

I saw that there is already a "jai_core.jar/jai_codec.jar" in "cfroot\lib" So I think that there is a conflict between the two JAI's. I removed mine, but I have another error : "An exception occurred when instantiating a Java object. The class must not be an interface or an abstract class. Error: com/sun/media/jai/codec/ImageEncodeParam."

I also tried to replace the JAI of CF8 by mine (just for a test) but I have the same error.

Do you have any idea of a solution ?

I know I can now use the CF8 tags to manipulate images, but I have to rewrite lots of code and I think there is still manipulations that CF8 can't handle (CMYK images, ICC profiles, ...)

Thanks in advance for your suggestions
TOPICS
Advanced techniques

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 03, 2007 Oct 03, 2007

Copy link to clipboard

Copied

I saw that there is already a "jai_core.jar/jai_codec.jar" in "cfroot\lib"

There is in fact a third, jai_imageio.jar. What about experimenting with Mark Mandel's Javaloader to load your own JAR files?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 03, 2007 Oct 03, 2007

Copy link to clipboard

Copied

The problem of the "javaloader solution" is that it works only if my previous code was calling JAI jar functions directly from Coldfusion
The problem is that I call my own jar files, that calls themselves the JAI methods (using import method).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Oct 03, 2007 Oct 03, 2007

Copy link to clipboard

Copied

> I have the following error (see attached),

I don't see an error message attached.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 04, 2007 Oct 04, 2007

Copy link to clipboard

Copied

You are right, with all these Adobe/Macromedia forums merge I rewrote 3 times my first post and forget the attached code. I edited an corrected it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Oct 04, 2007 Oct 04, 2007

Copy link to clipboard

Copied

> "An exception occurred when instantiating a Java object. The class must not
> be an interface or an abstract class. Error:

I don't know how you're using com/sun/media/jai/codec/ImageEncodeParam in your code but the error is clear. ImageEncodeParam is an interface in the CF8 jai_codec.jar. You can instantiate a concrete class, but not an interface. Possibly the private classes have changed since you first wrote the jar?

> I think that there is a conflict between the two JAI's.
>...
> Caused by: java.lang.SecurityException: sealing violation: package
> com.sun.media.jai.util is sealed

You could be right. If the jars are sealed having two of them in the classpath might cause that kind of error.




Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 05, 2007 Oct 05, 2007

Copy link to clipboard

Copied

Here is an idea, using the default jars that come with Coldfusion. Compile your class like this

javac -classpath c:/coldfusion8/lib/jai_core.jar;c:/coldfusion8/lib/jai_codec.jar;
c:/coldfusion8/lib/jai_imageio.jar GestionImages.java

and copy the class GestionImages.class to c:\coldfusion8\wwwroot\WEB-INF\classes


edited: later discovered jrun.jar doesn't play a part, so removed it from classpath

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 06, 2007 Oct 06, 2007

Copy link to clipboard

Copied

Cf_dev2 wrote:
> I don't know how you're using com/sun/media/jai/codec/ImageEncodeParam in your code but the error is clear. ImageEncodeParam is an interface in the CF8 jai_codec.jar.

Yep.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Oct 06, 2007 Oct 06, 2007

Copy link to clipboard

Copied

Yes, its hard to say for certain without seeing the code. Based on the exception though, I suspect the old code may be incompatible with the new classes/jars. One of the risks of using the private classes I guess. They'ld have to examine com.sun.media.jai.util in the CF8 jar and see how/if their code could be rewritten. Though I think ideally the code would avoid the private classes if possible.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 06, 2007 Oct 06, 2007

Copy link to clipboard

Copied

LATEST
Obouillaud wrote:
The problem of the "javaloader solution" is that it works only if my previous code was calling JAI jar functions directly from Coldfusion

From Coldfusion? No, on the contrary. Mark Mandel's Javaloader enables you to create objects from your own JAI jar package.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation