You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
to my servlet libs. I'm trying to read any CMYK image, for example:
From Wikipedia. The same image is loaded if I just run a test locally.
As a servlet, I get the following NullPointerException:
java.lang.NullPointerException
at com.twelvemonkeys.imageio.color.ColorSpaces.getColorSpace(ColorSpaces.java:265)
at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.getImageTypes(JPEGImageReader.java:232)
at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.readImageAsRasterAndReplaceColorProfile(JPEGImageReader.java:351)
at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:337)
at javax.imageio.ImageIO.read(ImageIO.java:1422)
...
It seems really odd, that this line would cause a NPE, as the code in com.twelvemonkeys.imageio.color.ColorSpaces just reads:
profile = genericCMYK.get();
and the genericCMYK is a static variable:
private static WeakReference<ICC_Profile> genericCMYK = new WeakReference<ICC_Profile>(null);
that does not seem to be nulled anywhere.
The text was updated successfully, but these errors were encountered:
A restart of the server fixed the issue.
For anyone stumbling across this in the future, make sure you do not just redeploy your war files over and over but actually restart the tomcat server.
Very sorry for the inconvenience.
Just a quick question: Did you do as described in the readme about deploying the plugins in a web app? I'm curious, as this is one of the problems that the IIOProviderContextListener is supposed to fix. You shouldn't have to restart your tomcat server for each redeploy.
Yes, I actually followed the README and added the listener to the web-app xml file.
ImageIO.read(…) correctly used the twelvemonkeys classes to load the jpg so at least some part worked correctly.
I don't know what the problem was but if it doesn't come back I'm writing this one off as a random problem in tomcat / our deployment.
Based on the latest version of this github repository (running java 1.6.0_16 and Debian 4.1.2-25). I build the project with maven and then added
to my servlet libs. I'm trying to read any CMYK image, for example:
From Wikipedia. The same image is loaded if I just run a test locally.
As a servlet, I get the following NullPointerException:
It seems really odd, that this line would cause a NPE, as the code in com.twelvemonkeys.imageio.color.ColorSpaces just reads:
and the genericCMYK is a static variable:
that does not seem to be nulled anywhere.
The text was updated successfully, but these errors were encountered: