Author Topic: Bug in CollisionListener or addCollisionListener or something  (Read 8968 times)

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Bug in CollisionListener or addCollisionListener or something
« Reply #1 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.
« Last Edit: May 05, 2008, 06:19:25 pm by EgonOlsen »

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
Re: Bug in CollisionListener or addCollisionListener or something
« Reply #2 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?
Nada por ahora

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Bug in CollisionListener or addCollisionListener or something
« Reply #3 on: May 12, 2008, 07:39:00 pm »
Maybe you listener contains references to objects that aren't serializable?

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
Re: Bug in CollisionListener or addCollisionListener or something
« Reply #4 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.
Nada por ahora