I currently encounter a very strange error: When I start my application with parameters -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
and remotely connect via Eclipse, everything works. When I remove this parameter (nothing else changed), I get the following exception:
Caused by: javax.imageio.IIOException: I/O error reading PNG header!
at com.sun.imageio.plugins.png.PNGImageReader.readHeader(PNGImageReader.java:315) ~[na:1.8.0_92]
at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:654) ~[na:1.8.0_92]
at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1248) ~[na:1.8.0_92]
at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1606) ~[na:1.8.0_92]
at javax.imageio.ImageIO.read(ImageIO.java:1448) ~[na:1.8.0_92]
at javax.imageio.ImageIO.read(ImageIO.java:1400) ~[na:1.8.0_92]
at com.jgoodies.application.ResourceConverters$DefaultConverter.convertImage(ResourceConverters.java:452) ~[retest.jar:1.2.0-SNAPSHOT]
... 43 common frames omitted
Caused by: javax.imageio.IIOException: Bad length for IHDR chunk!
at com.sun.imageio.plugins.png.PNGImageReader.readHeader(PNGImageReader.java:247) ~[na:1.8.0_92]
... 49 common frames omitted
Since I really, really didn't change anything else, I do suppose it has nothing to do with this problem, as the image file obviously is undamaged.
Since this is a foreign project for me, it could have to do something with 3rd party libraries or likewise. I am on a Mac, Java 1.8.0_92, if this could be relevant.
Update: If I remove a specific jar file, the problem also goes away. However, then I get NoClassDefFoundError
s later, so the jar file is needed. Any ideas, suggestions on how to proceed?
I was finally able to resolve the problem, although I am not completely sure what caused it and why it was a Heisenbug.
The offending jar indeed hat a ImageReaderSpi
as suggested by haraldK in the comment, but it also had some sort of obfuscation runtime-magic in place.