Hi Jeremias, Jeremias Maerki <[EMAIL PROTECTED]> wrote on 12/05/2008 03:55:42 AM:
> I can reproduce the issue with this test case. It really only happens in > the multi-threading case (running against Batik Trunk). As soon as you > place break-points before the exception (NumberFormatException) can > happen, it won't. I'm not sure where to start looking for the problem. > Maybe we can do something in FOP to avoid this. Help/hints would be > appreciated. I don't know how FOP loads and rasterizes SVG documents. If there is a global cache of Documents that have been read so the same Document Object ends up being used in both threads that would cause this problem. Checking the source it appears that fop.image.ImageFactory does this. There seem to be some options for sharing (or not) of images between contexts but it's not obvious to me how that works. Another option would be to deep clone the Document the second time (deciding that it's the second time is left as an exercise for the user of Batik ;). > Peter, there's one problem in your test case: You reuse the FOUserAgent > for all documents. That's not how it's supposed to be. You have to > create a new FOUserAgent for each processing run. Too bad, that doesn't > already fix the problem. ;-) This might let the 'context' stuff I mentioned above kick in. > > On 04.12.2008 23:58:57 Peter Coppens wrote: > > > > We have been able to reproduce with the following files > > > > http://www.nabble.com/file/p20844449/TestPijltje.java TestPijltje.java > > http://www.nabble.com/file/p20844449/pols.xml pols.xml > > http://www.nabble.com/file/p20844449/pols.xslt pols.xslt > > http://www.nabble.com/file/p20844449/pijltje.svg pijltje.svg > > > > TestPijltje.java is the test program. It starts two threads each of which > > will generate a pdf based on the pols.xslt stylesheet, pols.xml en > > pijltje.svg input file. > > > > If changing the code to only start one thread it always works fine. With two > > threads regular exceptions are thrown > > > > Stack trace is always something like > > > > Dec 4, 2008 11:54:33 PM org.apache.fop.svg.SVGUserAgent displayError > > SEVERE: SVG Errorfile:/Users/pc/Downloads/fop-0.95/pijltje.svg: > > The attribute "enable-background" represents an invalid CSS value ("new 0 0 > > 47.403 26.361"). > > Original message: > > Invalid number. > > org.w3c.dom.DOMException: file:/Users/pc/Downloads/fop-0.95/pijltje.svg: > > The attribute "enable-background" represents an invalid CSS value ("new 0 0 > > 47.403 26.361"). > > Original message: > > Invalid number. > > at org.apache.batik.css.engine.CSSEngine.getCascadedStyleMap(Unknown > > Source) > > at org.apache.batik.css.engine.CSSEngine.getComputedStyle(Unknown > > Source) > > at org.apache.batik.bridge.CSSUtilities.getComputedStyle(Unknown > > Source) > > at org.apache.batik.bridge.CSSUtilities.convertVisibility(Unknown > > Source) > > at > > org.apache.batik.bridge.SVGSVGElementBridge.createGraphicsNode(Unknown > > Source) > > at org.apache.batik.bridge.GVTBuilder.build(Unknown Source) > > at > > org.apache.fop.render.pdf.PDFSVGHandler. > renderSVGDocument(PDFSVGHandler.java:188) > > > > > > Any help warmly welcomed! > > > > Thanks > > > > Peter > > > > > > -- > > View this message in context: http://www.nabble.com/Batik- > exception-when-using-fop-with-svg-images-in-threaded-environment- > tp20809049p20844449.html > > Sent from the Batik - Users mailing list archive at Nabble.com. > > > > > > > > Jeremias Maerki > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] >
