SpiderMonkey serializer throwing an error

first off this works fine if i launch spider monkey as a different project but im try to launch it from a new thread and when i try to do this i get this error:
Uncaught exception thrown in Thread[jME3 Main,5,main]
RuntimeException: Serializer registry locked trying to register class:class com.jme3.network.message.SerializerRegistrationsMessage

this is when i try to connect as a Client to my server am i doing something wrong?

I found a post with the answer sorry for this post i thought i looked everywhere.

here is the post: [Solved for now]Serializer locked error. What does it mean? Version jme 3.1 - #6 by pspeed

Yeah, sorry about that. I really need to fix this bug.

Note: I just fixed this bug on master. I also modified the TestChatClient and TestChatServer to be slightly better examples (better error/connection state handling, etc.) and then added a TestChatClientAndServer that runs a client and server in the same JVM. I used this to test the bug.

With this bug fixed, the default services can be left in place and so the client doesn’t need to register serializers anymore. The server will send the client the registry during connect.

3 Likes

Only the server send that stuff to client or will client send if server hasn’t serialized the class yet as well?

The server is authoritative. All stuff must be registered there before the first client ever connects.

The other way around is really difficult to manage and doesn’t buy much.

Okay. Thanks for your help!!

It throws this “Uncaught exception thrown in Thread[jME3 Main,5,main]
RuntimeException: Serializer registry locked trying to register class:class com.jme3.network.message.SerializerRegistrationsMessage”

When i try a simple connection to a server thats on the same instance. i tried serializing the Server class but that didnt fix it. From what i thought you dont have to serialize ServerClass and Client class only messages

What version of JME are you running?

This was fixed some time back but there has not been a release since then so you will have to build spider monkey from source.

Ohh i see. ill look up how to do that then

If you don’t care about building the SDK and stuff then it’s really easy.

  1. check out the source
  2. gradlew dist
  3. change your project to depend on the jars in the dist/lib directory. In this case, just the jme3-network.jar.

Lol what can i search on youtube how to do that? that sounds pretty hard to me xD sorry. i understand where to download the source from github but idk what gradle dist means

Ok… sorry… I should have been more explicit…

  1. get the source code
  2. actually look in the source code directory
  3. run: gradlew dist (BECAUSE GRADLEW IS RIGHT THERE IN THE SOURCE DIRECTORY. ;))
  4. change your project to depend on the jars… etc.

Sometimes you have to forge ahead and see where you get stuck.

Okay thank you ill do that

gradlew is the gradle wrapper and makes it super convenient to get folks up and running because it’s checked right in with the source. So if you get the source, you automatically get what you need to build it. gradlew will automatically download and run the proper version of gradle if you don’t have it installed.

It’s a neat device.