Skip to content
Advertisement

Why does “ImageIO.read(URL input)” fail on some images on Weblogic 12c?

Alright, I have a problem that is driving me crazy!

I have a web application deployed on Weblogic 12.1.1 -i.e.:Weblogic 12c

At some point, I want to read an image File using:

JavaScript

The previous line fails on some images with the following so-stupid message:

JavaScript

Some advised that I change the HTTP handler for Weblogic using the the following parameter:

JavaScript

and it solved the problem yet I can’t implement this solution as it will be very risky.

What made me more crazy is that when I modify the picture using “Paint”, adding/removing some dummy colors and/or shapes, it passed!!

(Although not all changes will make it pass).

This is my first question here and I’d really appreciate your help.

P.S.: Problem appears only on “Weblogic 12c”, not 11g or anything else.

Edit: below is the Stack Trace:


JavaScript

Advertisement

Answer

As I’m almost sure now it’s a WebLogic Bug, I rewrote the code to be like:

JavaScript

The key difference in the new code is that it passes the read() method a [File] instance instead of a [URL] instance.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement