Skip to main content

Scenegraph Timer/Memory Access Exception caused -

5 replies [Last post]
sleep
Offline
Joined: 2008-05-26

I use Scenegraph 0.6 by including the available .jar and lately get the following exception in about one out of five program runs (meaning it is not directly reproducable):

<br />
exec] Unexpected exception caught in MasterTimer.timePulse():<br />
     [exec] java.util.ConcurrentModificationException<br />
     [exec] 	at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)<br />
     [exec] 	at java.util.AbstractList$Itr.next(AbstractList.java:343)<br />
     [exec] 	at java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1010)<br />
     [exec] 	at com.sun.scenario.scenegraph.SGNode.accumulateDirty(SGNode.java:739)<br />
....<br />

The exception itself is huge, but does not explicitly reference any of my code parts, so I have not point to start. Is there some memory access violation issue known in Scenegraph or is this likely caused by my code?

Many thanks in advance!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
idk
Offline
Joined: 2005-01-12

It seems you are accessing/mutating scene graph nodes off the event dispatch thread. Scene-graph does not support that.

-Igor

sleep
Offline
Joined: 2008-05-26

Thanks for the lightning-fast reply!

Although I think I understand the problem to a certain extent, I am not sure how to map it into debugging efforts.

In what ways could that have happened in JavaFX without a generic event system? Are there certain bind/replace trigger configurations or patterns that should be avoided?

Thanks again!

sleep
Offline
Joined: 2008-05-26

Alright, I apologize for my lack of knowledge. I read a little more on it and get the impression that by putting the relevant code parts into [i]do { ... }[/i] blocks, I should be able to get things done in a thread-safe way.

Shannon Hickey

Are you using the interpreted version of JavaFX or the new compiled
language? Are you using javafx.gui or javafx.ui? Are you explicitly
using Threads anywhere?

Thanks,
Shannon

scenario@javadesktop.org wrote:
> Alright, I apologize for my lack of knowledge. I read a little more on it and get the impression that by putting the relevant code parts into [i]do { ... }[/i] blocks, I should be able to get things done in a thread-safe way.
> [Message sent by forum member 'sleep' (sleep)]
>
> http://forums.java.net/jive/thread.jspa?messageID=279297
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
> For additional commands, e-mail: dev-help@scenegraph.dev.java.net
>

--
Shannon Hickey
shannon.hickey@sun.com
Swing Team - Sun Microsystems, Inc.
http://java.sun.com/javase/technologies/desktop

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
For additional commands, e-mail: dev-help@scenegraph.dev.java.net

sleep
Offline
Joined: 2008-05-26

I am using the compiled version of JavaFX and, since this morning, ported my code to javafx.gui. As the compiler still does not seem to accept [i]do {...}[/i] statements, I used a workaround by embedding the node manipulation parts in an animation that simply stops itself once the operations are done. I had some more problems but finally got it working by making the update animation a class attribute of my control class.

See: http://forums.java.net/jive/thread.jspa?threadID=41614&tstart=0

So no, I am not explicitly using threads other than a Timeline object.

URL added

Message was edited by: sleep