You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Joel Stevenson <js...@bearriver.com> on 2002/06/27 01:07:15 UTC

Error using servlet for external-graphic

Hi all,

I'm trying to use a servlet to generate a dynamic image and am seeing 
the following error:

6/26/02 3:16 PM -- 
http://localhost:8080/client/DoGetImage?w=200&h=100&leftmargin=1.5
6/26/02 3:16 PM -- Could not load external SVG: The current document 
is unable to create an element of the requested type (namespace: 
http://www.w3.org/2000/svg, name: head).Error while creating area : 
No ImageReader for this type of image 
(http://localhost:8080/client/DoGet Image?w=200&h=100&leftmargin=1.5)


The relevant FO source is:

<fo:external-graphic
src="http://localhost:8080/client/DoGetImage?w=200&amp;h=100&amp;leftmargin=1.5"/>

The image displays fine in a browser, but after adding some logging 
code to the servlet it appears that FOP is not calling it at all. 
Does anybody know what might be causing this error (querystring in 
the URL, use of a port number, etc)?

Much thanks,
Joel Stevenson

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Error using servlet for external-graphic

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Please don't crosspost to both dev and user.

Joel Stevenson wrote:
> I'm trying to use a servlet to generate a dynamic image and am seeing 
> the following error:
> 
> 6/26/02 3:16 PM -- 
> http://localhost:8080/client/DoGetImage?w=200&h=100&leftmargin=1.5
> 6/26/02 3:16 PM -- Could not load external SVG: The current document is 
> unable to create an element of the requested type (namespace: 
> http://www.w3.org/2000/svg, name: head).Error while creating area : No 
> ImageReader for this type of image (http://localhost:8080/client/DoGet 
> Image?w=200&h=100&leftmargin=1.5)

This means the SVG reader got an exception. Unfortunately,
I was not able to track it down in either the FOP or the
Batik source. It looks like it indicates there is a "head"
element in the SVG which is probably illegal.

> The relevant FO source is:
> 
> <fo:external-graphic
> src="http://localhost:8080/client/DoGetImage?w=200&amp;h=100&amp;leftmargin=1.5"/> 
> 
> The image displays fine in a browser, but after adding some logging code 
> to the servlet it appears that FOP is not calling it at all. Does 
> anybody know what might be causing this error (querystring in the URL, 
> use of a port number, etc)?

The exception above implies a successful connection to the server,
and it seems something was downloaded.
Check the access logs of your server whether the URL was accessed.
Try to use a HTML download utility like wget to retrieve the SVG
and save it to disk. Point your fo:external-graphic to the disk
file and check whether the problem persists. If so, it wasn't the
URL. Try to load the saved SVG into the Batik command line viewer.
This should give a more detailed error message if there is still
a problem.

J.Pietschmann