You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by bu...@apache.org on 2006/02/07 18:31:27 UTC

DO NOT REPLY [Bug 38558] New: - ClassCastException when referencing an external svg file from within a dynamic svg doc

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38558

           Summary: ClassCastException when referencing an external svg file
                    from within a dynamic svg doc
           Product: Batik
           Version: 1.6
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: SVG Viewer
        AssignedTo: batik-dev@xmlgraphics.apache.org
        ReportedBy: patrickegan@sml.com


I have an application that uses a dynamic JSVGCanvas (using SVN code 
2005/02/07). However if I open an svg doc that references another svg doc via 
the <image> tag, document rendering fails.
This only happens if the <image> is svg, png and jpeg images are not affected.

I can get the same error to occur in Squiggle if I add an empty <script/> tag 
to force the document to be dynamic.

I get the following error :-

java.lang.ClassCastException     at
org.apache.batik.bridge.svg12.SVG12BridgeContext.addUIEventListeners(Unknown
Source)     at
org.apache.batik.bridge.BridgeContext.createSubBridgeContext(Unknown Source)
at
org.apache.batik.bridge.svg12.SVG12BridgeContext.createSubBridgeContext(Unkn
own Source)     at
org.apache.batik.bridge.SVGImageElementBridge.createSVGImageNode(Unknown
Source)     at
org.apache.batik.bridge.SVGImageElementBridge.createRasterImageNode(Unknown
Source)     at
org.apache.batik.bridge.SVGImageElementBridge.createImageGraphicsNode(Unknow
n Source)     at
org.apache.batik.bridge.SVGImageElementBridge.buildImageGraphicsNode(Unknown
Source)     at
org.apache.batik.bridge.SVGImageElementBridge.createGraphicsNode(Unknown
Source)     at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown
Source)     at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown
Source)     at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown
Source)     at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown
Source)     at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown
Source)     at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown
Source)     at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown
Source)     at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown
Source)     at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)     at
org.apache.batik.swing.svg.GVTTreeBuilder.run(Unknown Source) 


==============================

Sample svg file that works fine as long as the <script> tag is commented out.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg contentScriptType="text/ecmascript" zoomAndPan="magnify" 
xmlns:svg="http://www.w3.org/2000/svg" 
xmlns:xlink="http://www.w3.org/1999/xlink"

contentStyleType="text/css" version="1.2" width="326" 
preserveAspectRatio="none"  viewBox="0 0 326 105" height="105"

xmlns="http://www.w3.org/2000/svg" >
<!-- <script type="text/ecmascript">
  var svgNamespaceURI = "http://www.w3.org/2000/svg";
</script> -->
<image  width="100" xmlns:xlink="http://www.w3.org/1999/xlink" 
xlink:href="n.svg" xlink:type="simple" xlink:actuate="onLoad" height="30"

preserveAspectRatio="xMidYMid meet" xlink:show="embed" overflow="visible"/>

<text x="20" font-size="8" y="40" font-family="Serif">test</text>

</svg>


========================================
the n.svg referenced from <image> tag
========================================

<?xml version="1.0" encoding="utf-8"?>
<svg  xmlns="http://www.w3.org/2000/svg" version="1.2"   
   width="87.118pt" height="16.598pt" viewBox="0 0 87.118 16.598" 
xml:space="preserve">
   <text y="20" x="20">n</text>
</svg>

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 38558] - ClassCastException when referencing an external svg file from within a dynamic svg doc

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38558


patrickegan@sml.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From patrickegan@sml.com  2006-02-08 10:36 -------
Hi Cameron,
That has fixed it.
Many thanks for looking into this so quickly.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 38558] - ClassCastException when referencing an external svg file from within a dynamic svg doc

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38558>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38558





------- Additional Comments From cam@apache.org  2006-02-08 01:03 -------
I've just committed a fix to SVN.  Can you please make sure it resolves your
problem, thanks.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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