www.jpct.net

jPCT - a 3d engine for Java => Bugs => Topic started by: Melssj5 on May 05, 2008, 05:53:29 am

Title: Bug in CollisionListener or addCollisionListener or something
Post by: Melssj5 on May 05, 2008, 05:53:29 am
Hi, I think there is a bug in CollisionListener or addCollisionListener or something. This is the problem :o

I have a class (on the server side) wich implements the CollisionListener, when I do:

first: Object3D.addCollisionListener (this);
then: ObjectOutputStream.writeObject (Object3D);

I am getting a not Serializable exception. I dont know why.

But if instead I try to do this:

first: ObjectOutputStream.writeObject (Object3D);
inmediatly: Object3D.addCollisionListener (this);


I got an OptionalDataException with EOF=true.


I guess that there is some kind of problem with serialization and the collision listening.
Title: Re: Bug in CollisionListener or addCollisionListener or something
Post by: EgonOlsen on May 05, 2008, 09:29:38 am
The listener interface lacks implementation of java.io.Serializable. I'll add that. However, you should be able to work around it, by letting your implementation implement that interface instead.

Edit: Added it in 1.16.
Title: Re: Bug in CollisionListener or addCollisionListener or something
Post by: Melssj5 on May 12, 2008, 07:28:25 pm
I am still having the problem. I added the Serializable interface to the class with the CollisionListener and nothing was fixed, I also used the new 1.16 release and I am still having the same results.

The exceptions are being thrown on the client, everything works if I remove the addCollisionListener on the object to transfer. Maybe when having a listener added to an object3D it cant be copied or tranfered because in it has a reference to a server side class or IDK. What can I do?
Title: Re: Bug in CollisionListener or addCollisionListener or something
Post by: EgonOlsen on May 12, 2008, 07:39:00 pm
Maybe you listener contains references to objects that aren't serializable?
Title: Re: Bug in CollisionListener or addCollisionListener or something
Post by: Melssj5 on May 19, 2008, 06:25:03 pm
well, I create a class dedicated to be my collision listener. Actually I am not getting all those exceptions.