xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cameron McCormack <...@mcc.id.au>
Subject Re: Exception : "Unable to make sense of URL for connection"
Date Wed, 15 Apr 2009 07:58:54 GMT
Hi Claire.

Claire SERRANO:
> I work on a Java application based upon batik. It contains a JSVGCanvas
> displaying the content of a SVGDocument. That document might be modified.
> All modifications are performed in Batik's update manager thread. 
…
> Everything's ok when we load the document in squiggle but not in our
> application, we have this exception when we draw an arrow:
> org.apache.batik.bridge.BridgeException: Unable to make sense of URL for
> connection

The problem may be that the document doesn’t have a URI, so it is unable
to resolve the relative URI “#TMTRIANGLE”, even though it should be in
the same document.

How are you creating the SVGDocument?  You could try calling
setDocumentURI() on it (after casting it to SVGOMDocument) to give it a
URI of some sort.  If the document needs to be able to have relative
reference to files on the local file system, give it a URI like
"file:///some/where/file.svg"; then it will be able to resolve relative
URIs to files in the /some/where directory.  Or, if you don’t need to
reference local files relatively, even something like
"http://example.com/" should do.

Do that setDocumentURI() call just after you have built the document and
before you have installed it in the JSVGCanvas.

-- 
Cameron McCormack ≝ http://mcc.id.au/

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message