I have a servlet based code to render data from a database. I use Batik to rasterize an SVG image into a JPEG or PNG image before it goes out to be displayed in the browser. My system works fine when I have only one servlet. But once I add a second servlet which also makes use of Batik, I get the following message on first try:
java.lang.ExceptionInInitializerError: java.lang.IllegalArgumentException: Instance(10100) of org.apache.batik.ext.awt.TranscodingHintKey already registered at java.awt.RenderingHints$Key.recordIdentity(RenderingHints.java:45) at java.awt.RenderingHints$Key.(RenderingHints.java:64) at org.apache.batik.ext.awt.TranscodingHintKey.(Unknown Source) at org.apache.batik.ext.awt.RenderingHintsKeyExt.(Unknown Source) at org.apache.batik.ext.awt.image.GraphicsUtil.createGraphics(Unknown Source) at org.apache.batik.gvt.filter.GraphicsNodeRed8Bit.genRect(Unknown Source) at org.apache.batik.gvt.filter.GraphicsNodeRed8Bit.copyData(Unknown Source) at org.apache.batik.ext.awt.image.rendered.TileCacheRed.genRect(Unknown Source) at org.apache.batik.ext.awt.image.rendered.AbstractTiledRed.copyToRasterByBlock s(Unknown Source) at org.apache.batik.ext.awt.image.rendered.AbstractTiledRed.copyData(Unknown Source) at org.apache.batik.ext.awt.image.rendered.TranslateRed.copyData(Unknown Source) at org.apache.batik.ext.awt.image.rendered.PadRed.copyData(Unknown Source) at org.apache.batik.gvt.renderer.StaticRenderer.repaint(Unknown Source) at org.apache.batik.transcoder.image.ImageTranscoder.transcode(Unknown Source) at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown Source) ...and the following one in all the subsequent tries: java.lang.NoClassDefFoundError at org.apache.batik.ext.awt.image.GraphicsUtil.createGraphics(Unknown Source) at org.apache.batik.gvt.filter.GraphicsNodeRed8Bit.genRect(Unknown Source) at org.apache.batik.gvt.filter.GraphicsNodeRed8Bit.copyData(Unknown Source) at org.apache.batik.ext.awt.image.rendered.TileCacheRed.genRect(Unknown Source) at org.apache.batik.ext.awt.image.rendered.AbstractTiledRed.copyToRasterByBlock s(Unknown Source) at org.apache.batik.ext.awt.image.rendered.AbstractTiledRed.copyData(Unknown Source) at org.apache.batik.ext.awt.image.rendered.TranslateRed.copyData(Unknown Source) at org.apache.batik.ext.awt.image.rendered.PadRed.copyData(Unknown Source) at org.apache.batik.gvt.renderer.StaticRenderer.repaint(Unknown Source) at org.apache.batik.transcoder.image.ImageTranscoder.transcode(Unknown Source) at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown Source) The order in which I call the servlets is important. The one which I call first works, and the one which I call secondly will fail. What is the problem? With thanks, Lassi Lehto Lassi Lehto, Lic. Tech., Research Scientist Finnish Geodetic Institute Department of Geoinformatics and Cartography PO Box 15, FIN-02431 Masala FINLAND E-mail: [EMAIL PROTECTED] Tel: +358-9-29555210 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
