Skip to main content

Exception in 1.3.2-pre9-0411091442-experimental

9 replies [Last post]
nikolai
Offline
Joined: 2003-06-10

Could someone give a clue to what this means?

I do this operation from the J3D-Behavior thread:

java.lang.NullPointerException
at javax.media.j3d.NodeRetained.clearLive(NodeRetained.java:688)
at javax.media.j3d.GroupRetained.clearLive(GroupRetained.java:2593)
at javax.media.j3d.GroupRetained.clearLive(GroupRetained.java:2641)
at
javax.media.j3d.TransformGroupRetained.clearLive(TransformGroupRetained.java:733)
at javax.media.j3d.GroupRetained.clearLive(GroupRetained.java:2641)
at
javax.media.j3d.GroupRetained.checkClearLive(GroupRetained.java:1704)
at
javax.media.j3d.GroupRetained.checkClearLive(GroupRetained.java:1641)
at
javax.media.j3d.GroupRetained.doRemoveChild(GroupRetained.java:389)
at javax.media.j3d.GroupRetained.doMoveTo(GroupRetained.java:560)
at javax.media.j3d.GroupRetained.moveTo(GroupRetained.java:494)
at javax.media.j3d.Group.moveTo(Group.java:287)

Found matching hashKey in setNodeData.
We're in TROUBLE!!!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kcr
Offline
Joined: 2004-03-17

This is probably a Java 3D bug. If you have a simple test program please file an Issue and attach the program. Here is a pointer to the thread with information on how to do that.

http://www.javadesktop.org/forums/thread.jspa?threadID=6406

Thanks.

-- Kevin

nikolai
Offline
Joined: 2003-06-10

> If you have a simple test program please file an Issue and attach the program.

Sorry, I cannot think of any way to duplicate this simple. I get it fairly often though, but its hard to determine what exacly causes it. My app. is rather big.

Should I file an issue even if I cannot produce a test-program?

But maybe it can help you that after I get the above exception a couple of times, this came:

java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
at java.util.ArrayList.add(ArrayList.java:371)
at javax.media.j3d.Shape3DRetained.doSetLive(Unknown Source)
at javax.media.j3d.Shape3DRetained.setLive(Unknown Source)
at javax.media.j3d.GroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.BranchGroupRetained.setLive(Unknown Source)
at javax.media.j3d.SharedGroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.setLive(Unknown Source)
at javax.media.j3d.SharedGroupRetained.setLive(Unknown Source)
at javax.media.j3d.LinkRetained.setLive(Unknown Source)
at javax.media.j3d.GroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.BranchGroupRetained.setLive(Unknown Source)
at javax.media.j3d.GroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.BranchGroupRetained.setLive(Unknown Source)
at javax.media.j3d.SharedGroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.setLive(Unknown Source)
at javax.media.j3d.SharedGroupRetained.setLive(Unknown Source)
at javax.media.j3d.LinkRetained.setLive(Unknown Source)
at javax.media.j3d.GroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.BranchGroupRetained.setLive(Unknown Source)
at javax.media.j3d.GroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.TransformGroupRetained.setLive(Unknown Source)
at javax.media.j3d.SharedGroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.setLive(Unknown Source)
at javax.media.j3d.SharedGroupRetained.setLive(Unknown Source)
at javax.media.j3d.LinkRetained.setLive(Unknown Source)
at javax.media.j3d.GroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.BranchGroupRetained.setLive(Unknown Source)
at javax.media.j3d.GroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.TransformGroupRetained.setLive(Unknown Source)
at javax.media.j3d.SharedGroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.setLive(Unknown Source)
at javax.media.j3d.SharedGroupRetained.setLive(Unknown Source)
at javax.media.j3d.LinkRetained.setLive(Unknown Source)
at javax.media.j3d.GroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.BranchGroupRetained.setLive(Unknown Source)
at javax.media.j3d.GroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.TransformGroupRetained.setLive(Unknown Source)
at javax.media.j3d.SharedGroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.setLive(Unknown Source)
at javax.media.j3d.SharedGroupRetained.setLive(Unknown Source)
at javax.media.j3d.LinkRetained.setLive(Unknown Source)
at javax.media.j3d.GroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.BranchGroupRetained.setLive(Unknown Source)
at javax.media.j3d.GroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.TransformGroupRetained.setLive(Unknown Source)
at javax.media.j3d.SharedGroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.setLive(Unknown Source)
at javax.media.j3d.SharedGroupRetained.setLive(Unknown Source)
at javax.media.j3d.LinkRetained.setLive(Unknown Source)
at javax.media.j3d.GroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.BranchGroupRetained.setLive(Unknown Source)
at javax.media.j3d.GroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.TransformGroupRetained.setLive(Unknown Source)
at javax.media.j3d.SharedGroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.setLive(Unknown Source)
at javax.media.j3d.SharedGroupRetained.setLive(Unknown Source)
at javax.media.j3d.LinkRetained.setLive(Unknown Source)
at javax.media.j3d.GroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.BranchGroupRetained.setLive(Unknown Source)
at javax.media.j3d.GroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.BranchGroupRetained.setLive(Unknown Source)
at javax.media.j3d.GroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.TransformGroupRetained.setLive(Unknown Source)
at javax.media.j3d.GroupRetained.childDoSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doSetLive(Unknown Source)
at javax.media.j3d.BranchGroupRetained.setLive(Unknown Source)
at javax.media.j3d.TransformGroupRetained.childCheckSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.checkSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.checkSetLive(Unknown Source)
at javax.media.j3d.GroupRetained.doAddChild(Unknown Source)
at javax.media.j3d.GroupRetained.doMoveTo(Unknown Source)
at javax.media.j3d.GroupRetained.moveTo(Unknown Source)
at javax.media.j3d.Group.moveTo(Unknown Source)

jada
Offline
Joined: 2004-03-17

Both traces seems to trigger from the moveTo method. It is a known bug the setLive/clearLive isn't MT safe in the current
Java 3D implementation. A good workaround that often works is to do such operation in a behavior. If you certain that is what you have done, I would suggest you not to use moveTo. Without a test program, we are unlikely to look at it for Java 3D 1.3.2 or 1.4.

- Chien.

nikolai
Offline
Joined: 2003-06-10

I do add/remove operations only from the j3d behavior thread.

But, I'll try not to use the moveto method and see if detach or add alone also can provoke this.

jada
Offline
Joined: 2004-03-17

Yes, this is certainly worth a try. Please do post your finding on this thread. Thanks!

- Chien.

nikolai
Offline
Joined: 2003-06-10

Detach also causes it.

jada
Offline
Joined: 2004-03-17

Did you get a similar trace as before ?
From your previous trace, you seems to have a deep scenegraph with nested shared groups. Detaching shared group from a live scenegraph can be very tricky and buggy. Are you detaching a sub-graph with nested SharedGroup this time ? How frequent do you execute add/remove operations in your apps.? If you are doing it quite frequently, Switch node can be your friend.
It will be great if you can submit a test program or a scaled down version of you apps for us to look at.

- Chien.

nikolai
Offline
Joined: 2003-06-10

I typically add/detach and rearange my scenegraph in chunks.

One chunk consists of:
...................................|
...............................BranchGroup
...................................|
.................................Switch
..........|........................|........................|
TransformGroup...TransformGroup.....TransformGroup(always Congruent)
..........|........................|........................|
Xj3D-Model & chunk...Sound stuff...maybe a viewplatform

In the model from Xj3D there are typically several shared groups.

The first TG is switched on/off depending on the visibility flag in my simulation core.

The middle TG is always visible. I use that to add chunks that contain sound, since there is a J3D bug when sound are switched.

The last TG I use in case a chunk contains a viewport, since my simulation core requires non-uniform scaling, I cannot just attach it to where I attach my Xj3D model.

Where I write I attach the Xj3D model, I sometimes attach all kinds of runtime constructed 3D stuff. Not only loaded models.

My simulation core is also graph based, and there is a 1 to 1 relationsship between components in that and J3D chunks like described above. And in my sim core the matrix4d can be non-congruent, but must always be affine.

So yes, I guess I stress the J3D scenegraph alot. And lately I have been doing something that requires alot of add/detaching of chunks. And reusing chunks just adding another model and removing the existing.

I cannot just use switch for add/detach, because it may not be added to same place.

And yes, I was detaching a sub-graph with nested SharedGroup when I get these exceptions.

jada
Offline
Joined: 2004-03-17

Nikolai,

1) Do you perform add and detach on the same SharedGroup, from different Link nodes, within the same frame ?

2) Do you have more than one Behavior nodes updating the scene with add/detach operations ?

3) Can you file an issue on this, and if possible, submit a scaled down version of you apps for us to look at ?

thanks,
Chien.