I think the "problem" originates from

1. FOP reusing the SVGDocument instance across threads
2. Batik attaching a org.apache.batik.css.parser.Parser to the SVGDocument
instance
3. Parser class not being thread safe

If in PDFSVGHandler, I replace

root = builder.build(ctx, doc);

with 

synchronized(doc) { root = builder.build(ctx, doc); }

the crash disappears.

I understand this is not the complete story. There are e.g. other
invocations of the build method and perhaps synchronization can appear
further up the rendering call stack even as far as into the Parser class,
making it thread safe.

For now, I guess I can continue without having to synchronize all FOP
renderings, but it would be far better if someone who knows the internals
takes a closer look at this and comes up with cleaner fix.

Thanks,

Peter
-- 
View this message in context: 
http://www.nabble.com/Batik-exception-when-using-fop-with-svg-images-in-threaded-environment-tp20809049p20872267.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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

Reply via email to