System: - debian squeeze - openjdk - tomcat6 - fop 1.1 rc1 - attached the servlet First, build fop 1.0 from source with ant and deployed fop.war to tomcat6. Had problems, see https://bugs.launchpad.net/ubuntu/+source/fop/+bug/268930. Copying xml-apis-ext.jar to /var/lib/tomcat6/webapps/fop/WEB-INF/lib/ fixed the problem. Then, upgrading to fop 1.1rc1, also built from source, keeps saying: Image not available. URI: [file]. Reason: org.apache.xmlgraphics.image.loader.ImageException: The file format is not supported. No ImagePreloader found for [file] I feel that this is a build or dependency problem, because all libraries are in place.
The first question you should ask yourself is "did I provide all the essential information to understand this bug?" Unfortunately, you fail to provide any information on what kind of image file format is a problem, you fail to provide an input FO test file, you fail to provide a console output. In other words, you failed to create a meaningful bug report. I should just mark this bug as INVALID, but instead I'll mark it as NEEDINFO. Please read [1] before you proceed further. [1] http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
Did you put imageio tools JAR in the class path? Some image formats require this library in order for FOP to process them. That's justa guess at the issue though and we really need the information requested by Glenn.
Created attachment 29074 [details] console output
Sorry for bad communication. I understand I left out essential information. It is SVG images that are not working. Please find attached console output. Because my FO input file contains client information I need to generate a FO test file which I will upload today. As said, I feel that this is a build or dependency problem. When I run the FO file through the command line, as shown below, the pdf does contain images. fop-1.1rc1 $ ./fop -c ~/foconfig.xml ~/foinput.fo ~/fooutput.pdf
Created attachment 29075 [details] the servlet
Created attachment 29177 [details] Attachment includes minimal test for embedding SVG, result.pdf and console output
I only receive the error for SVG files. Other images are working OK. On the same Tomcat6 server I have FOP 1.0 running without any problems.
The problem does not occur when using command line interface.
I tested with jetty and it works. There are just a few tweaks that are needed. First, I used the default servlet that comes with FOP (used 1.1 rc1 too). Edit the servlet task in the build.xml to add the xml-apis*jar files (as you noticed they seem to be necessary). Then ant servlet creates the fop.war in the build directory. Copy that to the webapps folder of jetty, then java -jar start.jar. The input.fo file had to be changed so that the test.svg file is referenced by the full path (otherwise you need to tell the servlet to use a config file that specifies the base url).
After editing the build.xml and adding the line <include name="xml-apis*jar" /> it did work. I don't know why it did not work when added the .jar to the fop webapp directory. Maybe (probably) because I made a mistake. Anyway, it would be great if the line would added to build.xml as default. I'd love to create a patch, but never done that before. Furthermore, I would also suggest to use my servlet (will attach new file) as default FopServlet, because it enables to attach a config to your request. I am also working on error handling in the servlet because I believe you should be able to debug your FO/XSL/XML files when the process fails.
Created attachment 29211 [details] the servlet
with jetty, the *.war file placed in the webapps is deployed to a new directory when jetty starts; jar files in the webapps directory are not deployed, and they are not picked up either if they are added to the deployment directory after jetty starts. tomcat probably does something similar... if you would like your servlet to be considered for integration in the trunk you need to submit a patch. if you used eclipse to get the source you can easily create one with Team -> Create Patch. you should also then edit the title and add [PATCH] to it.