(SpiderMonkey) the server crashes on unregistered class

When someone else sends an unregistered class to my server, it crashes. This kinda sucks, because this way people can easily take down my server.

I remember that there was a method in kryonet to disable those errors, is there a method in spidermonkey to do the same?

@patrickvane1993 said:
When someone else sends an unregistered class to my server, it crashes. This kinda sucks, because this way people can easily take down my server.
I remember that there was a method in kryonet to disable those errors, is there a method in spidermonkey to do the same?


If you wrote the server properly then it shouldn't crash. I get bad data packets sent randomly to Mythruna all the time and the server never goes down. It just logs a severe error, closes that connection, and goes on.

Can you provide the stack trace of the crash?

I fired low orbit ion cannon at my server, this is my stack trace:



[java]aug 07, 2012 8:19:24 AM com.jme3.network.base.KernelAdapter reportError

SEVERE: Unhandled error, endpoint:NioEndpoint[101, java.nio.channels.SocketChannel[connected local=/127.0.0.1:9000 remote=/127.0.0.1:51123]], context:Envelope[NioEndpoint[101, java.nio.channels.SocketChannel[connected local=/127.0.0.1:9000 remote=/127.0.0.1:51123]], reliable, 96]

java.lang.RuntimeException: Error deserializing object

at com.jme3.network.base.MessageProtocol.createMessage(MessageProtocol.java:185)

at com.jme3.network.base.MessageProtocol.addBuffer(MessageProtocol.java:161)

at com.jme3.network.base.KernelAdapter.createAndDispatch(KernelAdapter.java:217)

at com.jme3.network.base.KernelAdapter.run(KernelAdapter.java:281)

Caused by: com.jme3.network.serializing.SerializerException: Class not found for buffer data.

at com.jme3.network.serializing.Serializer.readClassAndObject(Serializer.java:359)

at com.jme3.network.base.MessageProtocol.createMessage(MessageProtocol.java:181)

… 3 more[/java]



This error just spams on and on, for every connection made. Hmm… this means the server isn’t going down, but spamming exceptions isn’t exactly useful either. Is there any way to catch the exception?

@patrickvane1993 said:
This error just spams on and on, for every connection made. Hmm... this means the server isn't going down, but spamming exceptions isn't exactly useful either. Is there any way to catch the exception?


Unfortunately, no. There is no error listener for the server yet... but as you've discovered the server stays up.

I have my logs filtered into various directions so this is less of an annoyance to me which is why I haven't gotten around to adding the error handler to the server yet. Sorry.

Ok, thanks for letting me know.