Highlighted

CFQuery update/insert using imageGetBlob() throwing Java error

Explorer ,
Dec 07, 2018

Copy link to clipboard

Copied

Our application reads an jpg image from the file system using <cfimage>.  it then tries to write the image to an Oracle 11g database using simple SQL to a field of type BLOB using the imageGetBlob().  This has been working for years until recently.  We have updated to an earlier java version but don't know whether this is the problem.

CF version 11,0,15,311399

Java version 1.8.0_191

error:  Caused by: java.lang.NoClassDefFoundError: com/sun/image/codec/jpeg/JPEGCodec at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.java:261)

                UPDATE my-table         SET SMALL_IMAGE = ,            MEDIUM_IMAGE = ,            LARGE_IMAGE =                 WHERE upc =

Some sites say that the above class has been deprecated in java 8 which makes sense as to why it's not found.  My question is what to do about it because it appears that the imageGetBlob() function is somehow still tied to it.  Any help is greatly appreciated.

Views

222

Likes

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

CFQuery update/insert using imageGetBlob() throwing Java error

Explorer ,
Dec 07, 2018

Copy link to clipboard

Copied

Our application reads an jpg image from the file system using <cfimage>.  it then tries to write the image to an Oracle 11g database using simple SQL to a field of type BLOB using the imageGetBlob().  This has been working for years until recently.  We have updated to an earlier java version but don't know whether this is the problem.

CF version 11,0,15,311399

Java version 1.8.0_191

error:  Caused by: java.lang.NoClassDefFoundError: com/sun/image/codec/jpeg/JPEGCodec at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.java:261)

                UPDATE my-table         SET SMALL_IMAGE = ,            MEDIUM_IMAGE = ,            LARGE_IMAGE =                 WHERE upc =

Some sites say that the above class has been deprecated in java 8 which makes sense as to why it's not found.  My question is what to do about it because it appears that the imageGetBlob() function is somehow still tied to it.  Any help is greatly appreciated.

Views

223

Likes

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
Dec 07, 2018 0
Adobe Community Professional ,
Dec 07, 2018

Copy link to clipboard

Copied

Did  you either apply a CF 11 update or update to  Java from 8 from 7 recently?

If the former, check the update log for possible errors. If the latter, you may need to delete the cf class that was created for your cfml file (if it was compiled while you ran Java 7 but now you have Java 8).  In this case, just delete the entire cfclasses dir and restart CF, to be safe.

More on each can be found in a blog on each that I have done and list at the top of https://www.carehart.org/top.cfm.

Let us know if this helps or not.

/Charlie (server troubleshooter, carehart.org)

Likes

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
Reply
Loading...
Dec 07, 2018 0
Explorer ,
Dec 07, 2018

Copy link to clipboard

Copied

Yes, to both questions. We updated to CF 11 update 15 in mid September. Can't remember when we did java but it was recently. Thanks for your suggestions. I will try them this morning and let you know.

Ronnie

Likes

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
Reply
Loading...
Dec 07, 2018 0
ronboy30 LATEST
Explorer ,
Dec 17, 2018

Copy link to clipboard

Copied

I tried your suggestions and am still getting the same error.  I looked in the update log and the update was 100% successful.  No warnings/errors at all.  I deleted the class file in the cfclasses folder too and restarted ColdFusion.  Any other suggestions? 

Likes

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
Reply
Loading...
Dec 17, 2018 0