You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Claire SERRANO <se...@gmail.com> on 2009/04/14 14:32:49 UTC

Exception : "Unable to make sense of URL for connection"

Hello,
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. 

We try to draw an arrow (a path with an end marker), here is the
corresponding part of the SVG file : 

<defs>
...
<marker strokeWidth="strokeWidth" orient="auto" markerHeight="3"
id="TMTRIANGLE" viewBox="0 0 10 10" preserveAspectRatio="xMidYMid meet"
markerWidth="4" RefX="0" RefY="5">
<path d="M 0 0 L 10 5 L 0 10 z"/>
</marker>
<g id="TMLINE1" transform="translate(347.62036937627636,
375.9917173843783)">
<path fill="none" marker-end="url(#TMTRIANGLE)" d="M0,0
L47.90921757429453,23.768914145386418 L58.67950679642274,-10.770289222128213
" stroke-width="0.40" cursor="pointer" stroke="black"/>
</g>
...
</defs>

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

Thanks for your help.

Regards.

Claire. 
-- 
View this message in context: http://www.nabble.com/Exception-%3A-%22Unable-to-make-sense-of-URL-for-connection%22-tp23038584p23038584.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Re: Exception : "Unable to make sense of URL for connection"

Posted by Claire SERRANO <se...@gmail.com>.
It works very good!
Thanks.

-- 
View this message in context: http://www.nabble.com/Exception-%3A-%22Unable-to-make-sense-of-URL-for-connection%22-tp23038584p23073933.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Re: Exception : "Unable to make sense of URL for connection"

Posted by Cameron McCormack <ca...@mcc.id.au>.
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