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 Stephen Drake <st...@drakenz.com> on 2006/12/05 23:34:18 UTC

NullPointerException on removing svg 1.2 document from JSVGComponent

Hi,

I use JSVGComponent in my program to display several pages of svg content. 
I have noticed NullPointerExceptions occuring sometimes when switching
quickly between pages.  I can reproduce the problem in squiggle as follows:

1.  Load any svg 1.2 document.
2.  Hit refresh a bunch of times.  Sometimes a double-click will do,
sometimes you need to be a bit more persistent.

After the exception occurs (stack trace below) the display area stays blank.

Inspection of the code shows that it is trying to access the document
without checking for null - but SVG12BridgeContext.dispose() and
BridgeContext.dispose() both check whether the document is null before
performing other operations.

Regards,
Steve Drake

java.lang.NullPointerException
        at
org.apache.batik.bridge.svg12.SVG12BridgeContext.dispose(SVG12BridgeContext.java:135)
        at
org.apache.batik.swing.svg.AbstractJSVGComponent.installSVGDocument(AbstractJSVGComponent.java:709)
        at
org.apache.batik.swing.JSVGCanvas.installSVGDocument(JSVGCanvas.java:585)
        at
org.apache.batik.swing.svg.AbstractJSVGComponent$2.run(AbstractJSVGComponent.java:667)
        at
org.apache.batik.swing.svg.AbstractJSVGComponent.stopThenRun(AbstractJSVGComponent.java:696)
        at
org.apache.batik.swing.svg.AbstractJSVGComponent.setSVGDocument(AbstractJSVGComponent.java:665)
        at
org.apache.batik.swing.svg.AbstractJSVGComponent$SVGListener.documentLoadingCompleted(AbstractJSVGComponent.java:1386)
        at
org.apache.batik.swing.svg.SVGDocumentLoader$2.dispatch(SVGDocumentLoader.java:145)
        at
org.apache.batik.util.EventDispatcher.dispatchEvent(EventDispatcher.java:103)
        at
org.apache.batik.util.EventDispatcher.fireEvent(EventDispatcher.java:87)
        at
org.apache.batik.util.EventDispatcher$1.run(EventDispatcher.java:46)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

-- 
View this message in context: http://www.nabble.com/NullPointerException-on-removing-svg-1.2-document-from-JSVGComponent-tf2764838.html#a7709700
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: NullPointerException on removing svg 1.2 document from JSVGComponent

Posted by th...@kodak.com.
Hi Stephen,

    I believe that this is now fixed in SVN.  Please test and get back to 
us.

   Also it is better to post bugs to the Batik bugzilla instance:
        http://issues.apache.org/bugzilla

   This ensures that even if we can't get to them right away they won't
be forgotten.  Also I try and make a pass through the bug database before
releases to make sure that bugs that are reasonable get fixed.

Stephen Drake <st...@drakenz.com> wrote on 12/06/2006 05:00:18 PM:

> thomas.deweese wrote:
> >    I can't reproduce this on my machine.
> 
> I tested several in the samples directory, for example
> samples/tests/spec12/structure/multi2.svg, and the following trivial 
case:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> 
> <svg xmlns="http://www.w3.org/2000/svg" version="1.2">
>   <rect x="5%" y="5%" width="90%" height="90%" />
> </svg>
> 
> 
> Stephen Drake wrote:
> > 
> >> 2.  Hit refresh a bunch of times.  Sometimes a double-click will
> >> do, sometimes you need to be a bit more persistent.
> > 
> Again, I might not have been entirely clear - by "a bit more persistent" 
I
> mean click refresh or hit ^R as fast as you can!  It might help to use a
> slower computer - I am using a P4 and and a G5, both 1.6 GHz.
> 
> Regards,
> Steve Drake
> 
> -- 
> View this message in context: http://www.nabble.
> com/NullPointerException-on-removing-svg-1.2-document-from-
> JSVGComponent-tf2764838.html#a7728839
> 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: NullPointerException on removing svg 1.2 document from JSVGComponent

Posted by Stephen Drake <st...@drakenz.com>.
Hi Thomas,


thomas.deweese wrote:
> 
>    I can't reproduce this on my machine.  I suspect
> the difference is the files being used.  Can you point to
> a file in the Batik samples directory or other public place
> that this happens for you with?
> 

I should have noted that I was using a recent build from svn.  I have also
tested with builds that I have sitting around from as far back as 14 June
2006, but I can't reproduce the problem with the 1.6 release.
I get the same result with every svg 1.2 file I have tried - I tested
several in the samples directory, for example
samples/tests/spec12/structure/multi2.svg, and the following trivial case:

<?xml version="1.0" encoding="UTF-8"?>

<svg xmlns="http://www.w3.org/2000/svg" version="1.2">
  <rect x="5%" y="5%" width="90%" height="90%" />
</svg>


Stephen Drake wrote:
> 
>> 2.  Hit refresh a bunch of times.  Sometimes a double-click will
>> do, sometimes you need to be a bit more persistent.
> 
Again, I might not have been entirely clear - by "a bit more persistent" I
mean click refresh or hit ^R as fast as you can!  It might help to use a
slower computer - I am using a P4 and and a G5, both 1.6 GHz.

Regards,
Steve Drake

-- 
View this message in context: http://www.nabble.com/NullPointerException-on-removing-svg-1.2-document-from-JSVGComponent-tf2764838.html#a7728839
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