Error using servlet for external-graphic

2002-06-27 Thread Joel Stevenson
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=200h=100leftmargin=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=200h=100leftmargin=1.5)

The relevant FO source is:
fo:external-graphic
src=http://localhost:8080/client/DoGetImage?w=200amp;h=100amp;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


Re: Error using servlet for external-graphic

2002-06-27 Thread J.Pietschmann
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=200h=100leftmargin=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=200h=100leftmargin=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=200amp;h=100amp;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