You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Todd Wesslen <tw...@esri.com> on 2001/12/04 00:12:17 UTC

svg raster generation in tomcat

Here is a unique problem:

I am generating a raster image (PNG) from a svg file dynamically in a web
application running under tomcat.  The first time this is done, i.e. anytime
the webapp is hit after the tomcat instance is first started, everything
works fine.  When I redeploy and hit the webapp, I get the following
exception:

java.lang.ExceptionInInitializerError: java.lang.IllegalArgumentException:
Instance(1000) of org.apache.batik.ext.awt.AreaOfInterestHintKey already
registered
        at
java.awt.RenderingHints$Key.recordIdentity(RenderingHints.java:45)
        at java.awt.RenderingHints$Key.<init>(RenderingHints.java:64)
        at org.apache.batik.ext.awt.AreaOfInterestHintKey.<init>(Unknown
Source)
        at org.apache.batik.ext.awt.RenderingHintsKeyExt.<clinit>(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)
        at org.apache.batik.apps.rasterizer.SVGConverter.transcode(Unknown
Source)
        at org.apache.batik.apps.rasterizer.SVGConverter.execute(Unknown
Source)
...

I am assuming that this is because the tomcat vm uses the same graphics
object for all webapps.  Is this correct?  In any case, I'm looking for a
fix to this.  I would like to be able to redeploy my application in tomcat
at any point in time and be able to generate raster images based on a svg
document written by my application.

Is there a way to "un-register" the AreaOfInterestKey so that I can use it
again when I redeploy?


Here is my setup:
tomcat4 
linux
jdk 1.3.1_01
batik 1.1rc4


Thanks,
Todd
twesslen@esri.com

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org