Registration error: no-argument constructor not found

I am trying to create a server for my game but everytime I run it, it throws off this error (See title). It points here:

Here is connected.class:
public class connected extends AbstractMessage {
public connected() {} // empty constructor

Any ideas on how to fix it? I am running only the code from the wiki page for spidermonkey but this error always appears. Thanks for all your help!

Here is the full error:
SEVERE: Uncaught exception thrown in Thread[Headless Application Thread,5,main]
java.lang.RuntimeException: Registration error: no-argument constructor not found on:class Server.Server$connected
at Server.Server.simpleInitApp(
at com.jme3.system.NullContext.initInThread(

“no-argument constructor not found on:class Server.Server$connected”

It’s because it’s not a static inner class. When you have a non-static inner class then there is a hidden parameter to the outer instance since you cannot instantiate a non-static inner class without having an instance of the outer class.

Make the class static or break it out into its own class. The latter is probably a safer idea since you will need this exact same class available on both client and server… registered in the EXACT same order.

1 Like

Sorry if this is an idiotic question but what do you mean by ‘‘breaking the class out’’?

Also, thanks so much for your answer! By setting the class as static, it works beautifully now! I still wonder what you meant with the latter solution though.

he meant,: put it in a own file as public class