Bug in CollisionListener or addCollisionListener or something

Started by Melssj5, May 05, 2008, 05:53:29 AM

Previous topic - Next topic

Melssj5

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.
Nada por ahora

EgonOlsen

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.

Melssj5

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?
Nada por ahora

EgonOlsen

Maybe you listener contains references to objects that aren't serializable?

Melssj5

well, I create a class dedicated to be my collision listener. Actually I am not getting all those exceptions.
Nada por ahora