I had the same problem... 

For the exception:
java.lang.ExceptionInInitializerError: java.lang.IllegalArgumentException:
Instance(10100) of org.apache.batik.ext.awt.TranscodingHintKey already
registered at...

It's a classloader problem... This error occurs when you have several classloaders : 
the first classloader loads Batik. If you use only this classloader, Batik is not 
loaded again... But if you use another classloader, this classloader does mot see that 
Batik is already loaded and loads it again !
It is also because these classloaders use both the same JVM classloader (that loads 
the 
java.awt.RenderingHints class which register the Batik keys)...

-----Message d'origine-----
De : Lassi Lehto [mailto:[EMAIL PROTECTED]]
Envoy� : mercredi 6 mars 2002 10:00
� : [EMAIL PROTECTED]
Objet : A second Batic instance failing


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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to