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

can't use java library

Advisor ,
Oct 06, 2009 Oct 06, 2009

Copy link to clipboard

Copied

Hi All,

I can't use the cfimage so I found a jar library that will help me to read images.

The library use three jar files jai_codec.jar, jai_core.jar and jimg.jar.

I'm using cf8 enter in a test enviroment so I copy this files to my lib folder

C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\lib

The component comes with cfc file that I copy into my COM folder.

Now when I use the component I have an error.

uploadedImage = createObject("component", "com.macromedia.image.jimg");

Error:                                                     Could not initialize class javax.media.jai.JAI

In CF7 works fine, CF8 doesn't accept jar files anymore?

Any ideas?

Thanks for your help.

JFB

TOPICS
Advanced techniques

Views

2.4K

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
Explorer ,
Oct 07, 2009 Oct 07, 2009

Copy link to clipboard

Copied

No, loading JAR and other Java libs works fine on CF8 and ALL versions that I tried recently...

I suspect that you are doing something wrong, but from you cut down error info I can not say what it is...

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
Advocate ,
Oct 07, 2009 Oct 07, 2009

Copy link to clipboard

Copied

There is a good utility for loading JARs from CFCs at RIAForge:

http://javaloader.riaforge.org/

Might help out ...

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
Advisor ,
Oct 07, 2009 Oct 07, 2009

Copy link to clipboard

Copied

Thanks for everyone reply and help!

Means that I have to call the jar everytime I open my app?

Or I can run this once and I will be available all the time?

Rgds

JFB

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
Valorous Hero ,
Oct 07, 2009 Oct 07, 2009

Copy link to clipboard

Copied

jfb00 wrote:

I can't use the cfimage

Why? Because you need a tool compatible with both MX7 and CF8?

jfb00 wrote:

The library use three jar files jai_codec.jar, jai_core.jar and jimg.jar.

I'm using cf8 enter in a test enviroment so I copy this files to my lib folder

As mentioned, there is no problem loading jars.  Post the full stack trace message.

Keep in mind CF8 already uses a version of JAI internally.  I am not sure about jimg.jar.  But loading another version of those jars into the classpath may cause version conflicts.  If you actually do need to load those jars, using the JavaLoader as Craig suggested may help.

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
Advisor ,
Oct 07, 2009 Oct 07, 2009

Copy link to clipboard

Copied

I apply an update from adobe and now cfimage works in CF8.

Thanks!

JFB

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
Valorous Hero ,
Oct 07, 2009 Oct 07, 2009

Copy link to clipboard

Copied

I apply an update from adobe and now cfimage works in CF8.

Good.  That is the right solution here 😉

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 ,
Jul 29, 2010 Jul 29, 2010

Copy link to clipboard

Copied

jfb00 wrote:

Hi All,

I can't use the cfimage so I found a jar library that will help me to read images.

The library use three jar files jai_codec.jar, jai_core.jar and jimg.jar.

I'm using cf8 enter in a test enviroment so I copy this files to my lib folder

C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\lib

The component comes with cfc file that I copy into my COM folder.

Now when I use the component I have an error.

uploadedImage = createObject("component", "com.macromedia.image.jimg");

Error:             &nb sp;           & nbsp;             &nb sp;           & nbsp; Could not initialize class javax.media.jai.JAI

In CF7 works fine, CF8 doesn't accept jar files anymore?

Any ideas?

Thanks for your help.

JFB

Can you please give me source link where did you download these libraries from?

I have been trying to find jimg library for a couple of days but I had no luck with that.

Can you please help in this regard

Thanks

Regards

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
Valorous Hero ,
Jul 29, 2010 Jul 29, 2010

Copy link to clipboard

Copied

What little I know about it suggests it is very old. That may be why you are having problems finding it. Is there a reason you need this library specifically? Because the functionality is built into CF8+ and there are also several free components available for for working with images such as

http://www.opensourcecf.com/imagecfc/

http://www.alagad.com/projects.imageComponent

...

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 ,
Jul 29, 2010 Jul 29, 2010

Copy link to clipboard

Copied

Thanks.

Yes! I have worked with images in CF8 and 9. I actually was needing the jimg library for Image Delivery System to the browser. I had to put it on CFMX6.1 relying on JRE-1.4.2 as I can not move the application to newer platform.

For image manipulation purposes I have used many custom tags (free & paid) but no one was working good on CFMX6.1 (on JRE-1.4.2). They worked good only to some specific type of images. Untill now I have used those custom tags and libraries for image manipulation but now when I got a need to manipulate BMP images on CF MX 6.1, None of the tag or the library worked. Any ways after struggling hard with no use, I've developed my own tag directly in Java now which is perfectly working with all kind of images. Also to mention that the Tags I had found all over the web, which were written in Java, were working good in CF8+ but only were troubling in CFMX6.1. I never tested on MX7 though as I never needed to and I don't have that.

The reason behind the BMP issue on CFMX6.1 was that, there was no support for BMP plugins untill Java v5. So that the Image maninpulation tags and libraries written in java were not able to work with all types of images which are not supported in the Java version bundled with CFMX6.1 when used under the Coldfusion earlier versions running with Java 1.4.2. But after finding that SUN has delivered the JAI-CORE API to all it's older versions of Java to add in, I just updated JRE with JAI-CORE Library on CFMX6.1 and wrote my on tag to fulfill my requirement at minimum of Image manipulation. Thanks for your links It would help me to more functions wit image manipulation.

Where as I was asking for the JIMG libraries, I was willing to have it now just for Image Delivery System on my application which will generate images on the fly to show up in the browser rather than using direct image paths. I was just willing to have it and to check what actully was in it and what it could do...

Thanks

Regards

Khurram A.

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
Valorous Hero ,
Jul 30, 2010 Jul 30, 2010

Copy link to clipboard

Copied

LATEST
The reason behind the BMP issue on CFMX6.1 was that, there was no support for BMP plugins untill Java v5. So that the Image maninpulation tags and libraries written in java were not able to work with all types of images which are not supported in the Java version bundled with CFMX6.1


      Yes, I know there were some limitations in earlier jre versions.  So I am glad updating the jai libraries did the trick.

Where as I was asking for the JIMG libraries, I was willing to have it now just for Image Delivery System on my application which will generate images on the fly to show up in the browser rather than using direct image paths. I was just willing to have it and to check what actully was in it and what it could do...

I do not know much about the JIMG library. But you should be able to deliver images directly to the browser, even in MX6.  Here is an old entry that might help. The author demonstrates how you can write binary data directly to the response stream.  That might be what you are looking for?

        http://blogs.adobe.com/cantrell/2003/06/using_coldfusio.html

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