Hi Fawzib,
Fawzib Rojas <[email protected]> wrote on 10/21/2010 12:46:13 PM:
> Since it cant find the attribute, there is no namespace. I added
> some code so that if there is no namespace it adds it.
>
> After those changes things moved along a little bit farther down the
> line but now batik gives me a NullPointerException in
> JPEGTranscoder.writeImage, I checked the output stream and it is
> valid, so must be something else:
It probably isn't finding the JPEG writer. So this line:
ImageWriter writer = ImageWriterRegistry.getInstance()
.getWriterFor("image/jpeg");
Is returning NULL. This is typically caused by Batik not
being able to find the file:
resources/META-INF/services/org.apache.batik.ext.awt.image.spi.ImageWriter
Or potentially an inability to create the JPEGImageWriter
(possibly due to a lack of the com.sun.image.codec.jpeg classes.
> Caused by: java.lang.NullPointerException
> at org.apache.batik.transcoder.image.JPEGTranscoder.writeImage
> (JPEGTranscoder.java:96)
> at org.apache.batik.transcoder.image.ImageTranscoder.transcode
> (ImageTranscoder.java:130)
> at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode
> (XMLAbstractTranscoder.java:142)
> at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode
> (SVGAbstractTranscoder.java:156)
> at org.apache.cocoon.serialization.SVGSerializerNG.notify
> (SVGSerializerNG.java:219)
> at org.apache.cocoon.xml.dom.SVGBuilder.endDocument(SVGBuilder.java:127)