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 Martin Constantine <ma...@lecture123.com> on 2007/02/14 18:16:10 UTC

NullPointerException after batik update

I upgraded to the latest svn build (2/13/2007) and received this stack 
trace which seemed to loop continuously.

java.lang.NullPointerException
        at org.apache.batik.anim.AnimationEngine.tick(Unknown Source)
        at org.apache.batik.bridge.SVGAnimationEngine.access$600(Unknown 
Source)
        at 
org.apache.batik.bridge.SVGAnimationEngine$AnimationTickRunnable.run(Unknown 
Source)

Appart from slowing down the app somewhat, there are no other bad side 
effects. I'm currently investigating the root cause, but I'm pretty sure 
I haven't seen this in the stable 1.6 release we been using for quite 
some time now. If anyone has seen this before and can shed some light, 
that would be great! Thanks in advance. 



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


Re: NullPointerException after batik update

Posted by Cameron McCormack <ca...@mcc.id.au>.
Cameron McCormack:
> Sorry I’m away at the moment and probably won’t get a chance to look at
> it for a couple of weeks.  After a *brief* look, it may be that that
> AnimationEngine.java:347 line,
> 
>   if (sandwich.shouldUpdate || sandwich.animation.isDirty) {
> 
> just needs a guard against the NPE with
> 
>   if (sandwich.shouldUpdate ||
>       sandwich.animation != null && sandwich.animation.isDirty) {
> 
> but I’ll have to investigate more deeply that there isn’t a deeper bug
> causing the problem.

I’ve (finally) commited this fix to SVN.

Cameron

-- 
Cameron McCormack, http://mcc.id.au/
	xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au

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


Re: NullPointerException after batik update

Posted by Martin Constantine <ma...@lecture123.com>.
After stress testing we discovered that there is a performance issue wrt 
to Overlays. our app implements the Overlay interface, to permit users 
to draw strokes on the canvas. When strokes are made with the mouse, all 
is fine, but if strokes are made with the pen from a tablet PC, there is 
significantly more lag. Could this be related in some way to the problem 
we were addressing?

Martin Constantine wrote:

> Cameron,
>
> I applied the fix you suggested and it worked. I have to do some 
> stress testing now to make sure but all seems well. I'll let you know 
> if I find anything, but in the mean time, I would recommend making 
> this fix permanent. Thanks again for your help!
>
> Martin
>
> Martin Constantine wrote:
>
>> Thank you mucho! I'll try that fix and report my findings. Stay tuned.
>>
>> Cameron McCormack wrote:
>>
>>> After a *brief* look, it may be that that
>>> AnimationEngine.java:347 line,
>>>
>>>   if (sandwich.shouldUpdate || sandwich.animation.isDirty) {
>>>
>>> just needs a guard against the NPE with
>>>
>>>   if (sandwich.shouldUpdate ||
>>>       sandwich.animation != null && sandwich.animation.isDirty) {
>>>
>>>   
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org



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


Re: NullPointerException after batik update

Posted by Martin Constantine <ma...@lecture123.com>.
Cameron,

I applied the fix you suggested and it worked. I have to do some stress 
testing now to make sure but all seems well. I'll let you know if I find 
anything, but in the mean time, I would recommend making this fix 
permanent. Thanks again for your help!

Martin

Martin Constantine wrote:

> Thank you mucho! I'll try that fix and report my findings. Stay tuned.
>
> Cameron McCormack wrote:
>
>> After a *brief* look, it may be that that
>> AnimationEngine.java:347 line,
>>
>>   if (sandwich.shouldUpdate || sandwich.animation.isDirty) {
>>
>> just needs a guard against the NPE with
>>
>>   if (sandwich.shouldUpdate ||
>>       sandwich.animation != null && sandwich.animation.isDirty) {
>>
>>   
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org



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


Re: NullPointerException after batik update

Posted by Martin Constantine <ma...@lecture123.com>.
Thank you mucho! I'll try that fix and report my findings. Stay tuned.

Cameron McCormack wrote:
> After a *brief* look, it may be that that
> AnimationEngine.java:347 line,
>
>   if (sandwich.shouldUpdate || sandwich.animation.isDirty) {
>
> just needs a guard against the NPE with
>
>   if (sandwich.shouldUpdate ||
>       sandwich.animation != null && sandwich.animation.isDirty) {
>
>   


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


Re: NullPointerException after batik update

Posted by Cameron McCormack <ca...@mcc.id.au>.
Martin Constantine:
> Were you able to have a second look at this? Please let me know if you 
> need anything from me. I'm eager to help getting this resolved. Thanks.

Sorry I’m away at the moment and probably won’t get a chance to look at
it for a couple of weeks.  After a *brief* look, it may be that that
AnimationEngine.java:347 line,

  if (sandwich.shouldUpdate || sandwich.animation.isDirty) {

just needs a guard against the NPE with

  if (sandwich.shouldUpdate ||
      sandwich.animation != null && sandwich.animation.isDirty) {

but I’ll have to investigate more deeply that there isn’t a deeper bug
causing the problem.

Thanks,

Cameron

-- 
Cameron McCormack, http://mcc.id.au/
	xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au

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


Re: NullPointerException after batik update

Posted by Martin Constantine <ma...@lecture123.com>.
Hi Cameron,

Were you able to have a second look at this? Please let me know if you 
need anything from me. I'm eager to help getting this resolved. Thanks.

Martin

Martin Constantine wrote:
> A little info which might be helpful:
>
> 1) Using a plain canvas, I scribbled, then went to another plain canvas,
> no problem (forward movement seems to work ok). (slide1.svg)
> 2) I then revisited the slide. Still no problem. (slide1.svg)
> 3) The second I start to scribble on that slide, those NPEs come rolling
> across the console. The saved slide is slide3.svg
>
> Let me know if you need more info. Thanks.
>
> Martin.
>
>
>
> Martin Constantine wrote:
>> Rats!! Pre-mature rejoicing is never a good thing. Sorry. I was able to
>> get past navigating the first slides, then I revisited the slides and
>> saw a repeat of the symptoms. Here's the exception:
>>
>> java.lang.NullPointerException
>>         at
>> org.apache.batik.anim.AnimationEngine.tick(AnimationEngine.java:347)
>>         at
>> org.apache.batik.bridge.SVGAnimationEngine.access$600(SVGAnimationEngine.java:98) 
>>
>>         at
>> org.apache.batik.bridge.SVGAnimationEngine$AnimationTickRunnable.run(SVGAnimationEngine.java:844) 
>>
>>         at 
>> org.apache.batik.util.RunnableQueue.run(RunnableQueue.java:237)
>>         at java.lang.Thread.run(Thread.java:595)
>>
>> Once again, this seems to repeat endlessly until I end the session (I
>> didn't try to see if it ended when I scribbled). I tried Attaching 
>> the documents before and after I noticed the first delay but the mail 
>> server refused. These slides both had images
>> to begin with. Is there somewhere I can send these that won't reject 
>> them? Thanks.
>>
>> I will do some more testing in the mean time to see if I uncover
>> anything new.
>>
>> Martin Constantine wrote:
>>> Your fix worked! Much better!! Thanks a million!
>>>
>>>
>>> Cameron McCormack wrote:
>>>> Hi Martin.
>>>>
>>>> Martin Constantine:
>>>>  
>>>>> Any word on this issue? Do you need any clarification/information? 
>>>>> Please let me know what I can do to help. Thanks again.
>>>>>     
>>>>
>>>> Sorry, I’ve been a little busy lately.
>>>>
>>>> I had a look, and yes it seems there’s a bug there.  I wasn’t able to
>>>> reproduce it with the test file you gave, though.  I’ve committed a
>>>> change: please let me know if it fixes your problem.
>>>>
>>>> Thanks,
>>>>
>>>> Cameron
>>>>
>>>>   
>>>
>>
>>
>>
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


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


Re: NullPointerException after batik update

Posted by Martin Constantine <ma...@lecture123.com>.
A little info which might be helpful:

1) Using a plain canvas, I scribbled, then went to another plain canvas,
no problem (forward movement seems to work ok). (slide1.svg)
2) I then revisited the slide. Still no problem. (slide1.svg)
3) The second I start to scribble on that slide, those NPEs come rolling
across the console. The saved slide is slide3.svg

Let me know if you need more info. Thanks.

Martin.



Martin Constantine wrote:
> Rats!! Pre-mature rejoicing is never a good thing. Sorry. I was able to
> get past navigating the first slides, then I revisited the slides and
> saw a repeat of the symptoms. Here's the exception:
>
> java.lang.NullPointerException
>         at
> org.apache.batik.anim.AnimationEngine.tick(AnimationEngine.java:347)
>         at
> org.apache.batik.bridge.SVGAnimationEngine.access$600(SVGAnimationEngine.java:98) 
>
>         at
> org.apache.batik.bridge.SVGAnimationEngine$AnimationTickRunnable.run(SVGAnimationEngine.java:844) 
>
>         at 
> org.apache.batik.util.RunnableQueue.run(RunnableQueue.java:237)
>         at java.lang.Thread.run(Thread.java:595)
>
> Once again, this seems to repeat endlessly until I end the session (I
> didn't try to see if it ended when I scribbled). I tried Attaching the 
> documents before and after I noticed the first delay but the mail 
> server refused. These slides both had images
> to begin with. Is there somewhere I can send these that won't reject 
> them? Thanks.
>
> I will do some more testing in the mean time to see if I uncover
> anything new.
>
> Martin Constantine wrote:
>> Your fix worked! Much better!! Thanks a million!
>>
>>
>> Cameron McCormack wrote:
>>> Hi Martin.
>>>
>>> Martin Constantine:
>>>  
>>>> Any word on this issue? Do you need any clarification/information? 
>>>> Please let me know what I can do to help. Thanks again.
>>>>     
>>>
>>> Sorry, I’ve been a little busy lately.
>>>
>>> I had a look, and yes it seems there’s a bug there.  I wasn’t able to
>>> reproduce it with the test file you gave, though.  I’ve committed a
>>> change: please let me know if it fixes your problem.
>>>
>>> Thanks,
>>>
>>> Cameron
>>>
>>>   
>>
>
>
>



Re: NullPointerException after batik update

Posted by Martin Constantine <ma...@lecture123.com>.
Rats!! Pre-mature rejoicing is never a good thing. Sorry. I was able to
get past navigating the first slides, then I revisited the slides and
saw a repeat of the symptoms. Here's the exception:

java.lang.NullPointerException
         at
org.apache.batik.anim.AnimationEngine.tick(AnimationEngine.java:347)
         at
org.apache.batik.bridge.SVGAnimationEngine.access$600(SVGAnimationEngine.java:98)
         at
org.apache.batik.bridge.SVGAnimationEngine$AnimationTickRunnable.run(SVGAnimationEngine.java:844)
         at org.apache.batik.util.RunnableQueue.run(RunnableQueue.java:237)
         at java.lang.Thread.run(Thread.java:595)

Once again, this seems to repeat endlessly until I end the session (I
didn't try to see if it ended when I scribbled). I tried Attaching the 
documents before and after I noticed the first delay but the mail server 
refused. These slides both had images
to begin with. Is there somewhere I can send these that won't reject 
them? Thanks.

I will do some more testing in the mean time to see if I uncover
anything new.

Martin Constantine wrote:
> Your fix worked! Much better!! Thanks a million!
>
>
> Cameron McCormack wrote:
>> Hi Martin.
>>
>> Martin Constantine:
>>   
>>> Any word on this issue? Do you need any clarification/information? 
>>> Please let me know what I can do to help. Thanks again.
>>>     
>>
>> Sorry, I’ve been a little busy lately.
>>
>> I had a look, and yes it seems there’s a bug there.  I wasn’t able to
>> reproduce it with the test file you gave, though.  I’ve committed a
>> change: please let me know if it fixes your problem.
>>
>> Thanks,
>>
>> Cameron
>>
>>   
>



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


Re: NullPointerException after batik update

Posted by Martin Constantine <ma...@lecture123.com>.
Your fix worked! Much better!! Thanks a million!


Cameron McCormack wrote:

>Hi Martin.
>
>Martin Constantine:
>  
>
>>Any word on this issue? Do you need any clarification/information? 
>>Please let me know what I can do to help. Thanks again.
>>    
>>
>
>Sorry, I’ve been a little busy lately.
>
>I had a look, and yes it seems there’s a bug there.  I wasn’t able to
>reproduce it with the test file you gave, though.  I’ve committed a
>change: please let me know if it fixes your problem.
>
>Thanks,
>
>Cameron
>
>  
>


Re: NullPointerException after batik update

Posted by Cameron McCormack <ca...@mcc.id.au>.
Hi Martin.

Martin Constantine:
> Any word on this issue? Do you need any clarification/information? 
> Please let me know what I can do to help. Thanks again.

Sorry, I’ve been a little busy lately.

I had a look, and yes it seems there’s a bug there.  I wasn’t able to
reproduce it with the test file you gave, though.  I’ve committed a
change: please let me know if it fixes your problem.

Thanks,

Cameron

-- 
Cameron McCormack, http://mcc.id.au/
	xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au

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


Re: NullPointerException after batik update

Posted by Martin Constantine <ma...@lecture123.com>.
Hi Cameron (anyone),

Any word on this issue? Do you need any clarification/information? 
Please let me know what I can do to help. Thanks again.

Martin.

Martin Constantine wrote:
> Cameron,
>
> Thanks for getting back to me. I apologize for the delayed response 
> but I've only had time to revisit this problem recently. Now the nitty 
> gritty....
>
> I was able to pinpoint the location where the exception is being 
> thrown. Here's a code snippet from AnimationEngine.java:
>
>  // Update the CSS animations.
>             j = info.cssAnimations.entrySet().iterator();
>             while (j.hasNext()) {              
>                 Map.Entry e2 = (Map.Entry) j.next();
>                 String propertyName = (String) e2.getKey();
>                 Sandwich sandwich = (Sandwich) 
> e2.getValue();              
>                 if (sandwich.shouldUpdate || sandwich.animation.isDirty) {
>                     ****AnimatableValue av = 
> sandwich.animation.getComposedValue();***
>
> ***Exception is thrown here (around line 352)
> As you can see from the java comment, it occurs when updating CSS 
> animations. The time argument at this point is either 68.829 or 73.586 
> (not sure which one) and from the line that the exception is thrown, 
> it seems like getComposedValue() is null. I attached the related 
> document.
>
> Feel free to correct me at any time because I'm fairly new to the 
> inner working of batik.
>
> Application Background
> -------------------------
> The application I'm working on records scribbles created on a canvas. 
> Each such canvas is part of a list which the user navigates. When the 
> user is done scribbling on one canvas, she goes to a new one and 
> scribbles some more, etc. This recording action is encapsulated in a 
> class that implements JGVTComponentListener. I'm guessing that there 
> is some link between what happens in this class and the calling of the 
> tick() method in AnimationEngine. At the moment that is obscure but 
> I'm learning as I go, so please bare with me.
>
> Possible reason for the NPE:
> tick() is being called when it shouldn't. What controlls tick()? Is it 
> called at regular intervals or just in response to some event? e.g. 
> when the user moves to a new canvas, the NPE manifests itself and 
> loops indefinitely until the user starts to draw again. It seems like 
> the animation is still running when there's nothing to process. Does 
> this make sense?
>
> Thanks in advance for your help.
>
> Martin.
>
> PS SVN revision info
> Revision: 511269
> Node Kind: directory
> Last Changed Date: 2007-02-20 20:12:30 -0500 (Tue, 20 Feb 2007)
>
>
>
>
> Cameron McCormack wrote:
>> Hi Martin.
>>
>> Martin Constantine:
>>   
>>> I upgraded to the latest svn build (2/13/2007) and received this stack 
>>> trace which seemed to loop continuously.
>>>
>>> java.lang.NullPointerException
>>>        at org.apache.batik.anim.AnimationEngine.tick(Unknown Source)
>>>        at org.apache.batik.bridge.SVGAnimationEngine.access$600(Unknown 
>>> Source)
>>>        at 
>>> org.apache.batik.bridge.SVGAnimationEngine$AnimationTickRunnable.run(Unknown 
>>> Source)
>>>
>>> Appart from slowing down the app somewhat, there are no other bad side 
>>> effects. I'm currently investigating the root cause, but I'm pretty sure 
>>> I haven't seen this in the stable 1.6 release we been using for quite 
>>> some time now. If anyone has seen this before and can shed some light, 
>>> that would be great! Thanks in advance. 
>>>     
>>
>> Are you able to provide a document that exhibits this exception?  If
>> not, can you explain how you’re using Batik and compile it with
>> debugging information so that I can see where the exception is
>> occurring?
>>
>> Thanks,
>>
>> Cameron
>>
>>   
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: NullPointerException after batik update

Posted by Martin Constantine <ma...@lecture123.com>.
Cameron,

Thanks for getting back to me. I apologize for the delayed response but 
I've only had time to revisit this problem recently. Now the nitty 
gritty....

I was able to pinpoint the location where the exception is being thrown. 
Here's a code snippet from AnimationEngine.java:

 // Update the CSS animations.
            j = info.cssAnimations.entrySet().iterator();
            while (j.hasNext()) {              
                Map.Entry e2 = (Map.Entry) j.next();
                String propertyName = (String) e2.getKey();
                Sandwich sandwich = (Sandwich) e2.getValue();              
                if (sandwich.shouldUpdate || sandwich.animation.isDirty) {
                    ****AnimatableValue av = 
sandwich.animation.getComposedValue();***

***Exception is thrown here (around line 352)
As you can see from the java comment, it occurs when updating CSS 
animations. The time argument at this point is either 68.829 or 73.586 
(not sure which one) and from the line that the exception is thrown, it 
seems like getComposedValue() is null. I attached the related document.

Feel free to correct me at any time because I'm fairly new to the inner 
working of batik.

Application Background
-------------------------
The application I'm working on records scribbles created on a canvas. 
Each such canvas is part of a list which the user navigates. When the 
user is done scribbling on one canvas, she goes to a new one and 
scribbles some more, etc. This recording action is encapsulated in a 
class that implements JGVTComponentListener. I'm guessing that there is 
some link between what happens in this class and the calling of the 
tick() method in AnimationEngine. At the moment that is obscure but I'm 
learning as I go, so please bare with me.

Possible reason for the NPE:
tick() is being called when it shouldn't. What controlls tick()? Is it 
called at regular intervals or just in response to some event? e.g. when 
the user moves to a new canvas, the NPE manifests itself and loops 
indefinitely until the user starts to draw again. It seems like the 
animation is still running when there's nothing to process. Does this 
make sense?

Thanks in advance for your help.

Martin.

PS SVN revision info
Revision: 511269
Node Kind: directory
Last Changed Date: 2007-02-20 20:12:30 -0500 (Tue, 20 Feb 2007)




Cameron McCormack wrote:
> Hi Martin.
>
> Martin Constantine:
>   
>> I upgraded to the latest svn build (2/13/2007) and received this stack 
>> trace which seemed to loop continuously.
>>
>> java.lang.NullPointerException
>>        at org.apache.batik.anim.AnimationEngine.tick(Unknown Source)
>>        at org.apache.batik.bridge.SVGAnimationEngine.access$600(Unknown 
>> Source)
>>        at 
>> org.apache.batik.bridge.SVGAnimationEngine$AnimationTickRunnable.run(Unknown 
>> Source)
>>
>> Appart from slowing down the app somewhat, there are no other bad side 
>> effects. I'm currently investigating the root cause, but I'm pretty sure 
>> I haven't seen this in the stable 1.6 release we been using for quite 
>> some time now. If anyone has seen this before and can shed some light, 
>> that would be great! Thanks in advance. 
>>     
>
> Are you able to provide a document that exhibits this exception?  If
> not, can you explain how you’re using Batik and compile it with
> debugging information so that I can see where the exception is
> occurring?
>
> Thanks,
>
> Cameron
>
>   


Re: NullPointerException after batik update

Posted by Cameron McCormack <ca...@mcc.id.au>.
Hi Martin.

Martin Constantine:
> I upgraded to the latest svn build (2/13/2007) and received this stack 
> trace which seemed to loop continuously.
> 
> java.lang.NullPointerException
>        at org.apache.batik.anim.AnimationEngine.tick(Unknown Source)
>        at org.apache.batik.bridge.SVGAnimationEngine.access$600(Unknown 
> Source)
>        at 
> org.apache.batik.bridge.SVGAnimationEngine$AnimationTickRunnable.run(Unknown 
> Source)
> 
> Appart from slowing down the app somewhat, there are no other bad side 
> effects. I'm currently investigating the root cause, but I'm pretty sure 
> I haven't seen this in the stable 1.6 release we been using for quite 
> some time now. If anyone has seen this before and can shed some light, 
> that would be great! Thanks in advance. 

Are you able to provide a document that exhibits this exception?  If
not, can you explain how you’re using Batik and compile it with
debugging information so that I can see where the exception is
occurring?

Thanks,

Cameron

-- 
Cameron McCormack, http://mcc.id.au/
	xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au

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