Bug 41440 - PDFSVGHandler causes missing resource bundle
Summary: PDFSVGHandler causes missing resource bundle
Status: NEW
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: pdf (show other bugs)
Version: 0.93
Hardware: Other All
: P3 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on: 41473
Blocks:
  Show dependency tree
 
Reported: 2007-01-23 03:26 UTC by David Irving
Modified: 2012-04-11 06:16 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Irving 2007-01-23 03:26:40 UTC
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.
Comment 1 Chris Bowditch 2007-01-23 04:39:08 UTC
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?
Comment 2 David Irving 2007-01-23 05:11:51 UTC
(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.

Comment 3 David Irving 2007-01-26 00:16:43 UTC
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
Comment 4 David Irving 2007-01-26 00:19:18 UTC
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.?
Comment 5 Jeremias Maerki 2007-01-26 01:29:50 UTC
(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.
Comment 6 Glenn Adams 2012-04-07 01:41:25 UTC
resetting P2 open bugs to P3 pending further review
Comment 7 Glenn Adams 2012-04-11 06:16:58 UTC
change status from ASSIGNED to NEW for consistency