THe following message reported within the PDFSVGHandler. 23.1.2007 11:21:52 org.apache.fop.render.pdf.PDFSVGHandler renderSVGDocument SEVERE: svg graphic could not be built: Can't find bundle for base name org.apache.fop.svg.resources.Messages, locale en java.util.MissingResourceException: Can't find bundle for base name org.apache.fop.svg.resources.Messages, locale en However, I cannot find the relevant resource bundle in the fop.jar file, or on the SVN server. http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk It is not in the binary build for 0.93 either. I have downloaded the sources for the distribution and cannot find it there either. The code I suspect the error comes from in the PDFSVGRenderer and is either... try { root.paint(graphics); pdfInfo.currentStream.add(graphics.getString()); } catch (Exception e) { log.error("svg graphic could not be rendered: " + e.getMessage(), e); } OR try { root = builder.build(ctx, doc); builder = null; } catch (Exception e) { log.error("svg graphic could not be built: " + e.getMessage(), e); return; } Project is trying to embed svg images into a pdf output. We are using the 0.93 FOP distribution.
How are you running FOP? From the command line or an embedded Application? If you are running from an embedded Application can you try running FOP from the command line to see if the error persists? If your XSL-FO can be processed from the command line then can you check that your embedded Application can find batik-all-1.6.jar on the classpath?
(In reply to comment #1) Embedded. However... after quick test on testing project, fop0.93 works with fo:external-graphic instructions without problems, this bug is existing on fo:instream-foreign-object instructions for example .. Currently retesting code after build from source, and will upload a simple example if this does not resolve it.
It would appear the exception is caused in use of invalid targets in the script. The localisation message also appears for EN version as well. *************************************************************** <!-- svg no.1 --> <fo:external-graphic src="file:/home/assan/javaproj/FOPTest/svg/boxes.svg"/> // FOP error message caused by svg no.1, if url of svg file is not valid: SEVERE: Image not available: file:/home/assan/javaproj/FOPTest/svg/boxes.svg *************************************************************** <!-- svg no.2 --> <fo:instream-foreign-object> <svg xmlns="http://www.w3.org/2000/svg" width="20mm" height="20mm" xml:space="preserve"> <svg viewBox="0 0 20 20" preserveAspectRatio="none"> <image xlink:href="file:/home/assan/javaproj/FOPTest/svg/boxes.svg" x="0" y="0" width="20mm" height="20mm"/> </svg> </svg> </fo:instream-foreign-object> // FOP error message caused by svg no.2, if url of svg file is not valid: SEVERE: svg graphic could not be built: Can't find bundle for base name org.apache.fop.svg.resources.Messages, locale cs_CZ java.util.MissingResourceException: Can't find bundle for base name org.apache.fop.svg.resources.Messages, locale cs_CZ Also gives same for locale en *************************************************************** <!-- svg no.3 --> <fo:instream-foreign-object> <svg xmlns="http://www.w3.org/2000/svg" width="100mm" height="100mm" xml:space="preserve"> <g transform="scale(10)"> <image xlink:href="file:/home/assan/javaproj/FOPTest/svg/boxes.svg" x="0" y="0" width="100mm" height="100mm"/> </g> </svg> </fo:instream-foreign-object> // FOP error message caused by svg no.3, if url of svg file is not valid: SEVERE: svg graphic could not be built: Can't find bundle for base name org.apache.fop.svg.resources.Messages, locale cs_CZ java.util.MissingResourceException: Can't find bundle for base name org.apache.fop.svg.resources.Messages, locale cs_CZ
You would expect an "Invalid target exception" but the response is that the relevant message bundle is not in the class path. Where is the required message bundle setup for the PDFSVGHandler.?
(In reply to comment #4) > You would expect an "Invalid target exception" but the response is that the > relevant message bundle is not in the class path. Where is the required message > bundle setup for the PDFSVGHandler.? It is in Batik's org.apache.batik.bridge.resources.Messages.properties. It seems that Batik's message i18n doesn't cope well with situations where Batik's classes are subclassed and used in other packages. In this case it's org.apache.fop.svg.PDFImageElementBridge which subclasses org.apache.batik.bridge.SVGImageElementBridge. Now, the IO error happens due to a missing file at the other end of the URL and Batik's i18n.LocalizableSupport.formatMessage() goes looking for the message bundle in the wrong place. I think we'll have to discuss the best course of action with the Batik people.
resetting P2 open bugs to P3 pending further review
change status from ASSIGNED to NEW for consistency