I'm seeing the following problem in error logs sent in by our users with
Java 7 and Batik 1.7. Here's a partial stack trace (the top is specific
to my own code, so I've cropped it):

Caused by: java.lang.NoClassDefFoundError: 
com/sun/image/codec/jpeg/TruncatedFileException
  at 
org.apache.batik.ext.awt.image.codec.jpeg.JPEGRegistryEntry.handleStream(JPEGRegistryEntry.java:87)
  at 
org.apache.batik.ext.awt.image.spi.ImageTagRegistry.readURL(ImageTagRegistry.java:189)
  at 
org.apache.batik.bridge.SVGImageElementBridge.createImageGraphicsNode(SVGImageElementBridge.java:258)
  at 
org.apache.batik.bridge.SVGImageElementBridge.buildImageGraphicsNode(SVGImageElementBridge.java:177)
  at 
org.apache.batik.bridge.SVGImageElementBridge.createGraphicsNode(SVGImageElementBridge.java:119)
  at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:213)
  at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171)
  at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:82)
  at 
org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:208)
  at 
VASSAL.tools.image.svg.SVGRenderer$Rasterizer.transcode(SVGRenderer.java:213)
  at 
org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTranscoder.java:142)
  at 
org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:156)
  at VASSAL.tools.image.svg.SVGRenderer.render(SVGRenderer.java:128)
  at 
VASSAL.tools.imageop.RotateScaleOpSVGImpl.eval(RotateScaleOpSVGImpl.java:117)
  at 
VASSAL.tools.imageop.RotateScaleOpSVGImpl.eval(RotateScaleOpSVGImpl.java:50)
  at VASSAL.tools.opcache.OpCache.getFuture(OpCache.java:311)
  ... 56 more
Caused by: java.lang.ClassNotFoundException: 
com.sun.image.codec.jpeg.TruncatedFileException
  at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
  ... 72 more

I believe this happens when trying to load a corrupt JPEG. It looks as 
though JPEGRegistryEntry.handleStream() is about to throw a
TruncatedFileException, which appears not to exist in Java 7. Is it
really a good idea for Batik to be using Sun-private parts of the JDK?
Can we get a fix for this?

-- 
J.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org

Reply via email to