Client Error

Exception in thread “LWJGL Renderer Thread” java.lang.ExceptionInInitializerError




at Bubby4j.BaseGame.connectToServer(

at makeza.client.Main.simpleInitApp(

at Bubby4j.BaseGame.initialize(

at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(


at Source)

Caused by: access denied (java.lang.reflect.ReflectPermission suppressAccessChecks)

at Source)

at Source)

at java.lang.SecurityManager.checkPermission(Unknown Source)

at java.lang.reflect.AccessibleObject.setAccessible(Unknown Source)





… 9 more

What’s this mean? All I’m doing is connecting successfully:

[java] try {

Client myClient = Network.connectToServer(host, port);


} catch (IOException ex) {

System.out.println(“Could not connect to Host: " + host + " Port: " + port + " Cause:”);

Logger.getLogger(BaseGame.class.getName()).log(Level.WARNING, null, ex);


The serializer requires direct access to the message/object fields when serializing. So it tries to setAccesible() in the fields which requires elevated security permissions.

What environment are you running your client in?

IMO It should still work even if running in a restricted environment. Currently jME3 applet deployment runs without elevated permissions. For serialization to work however, it requires all the fields in a message and the fields inside objects to be public.

It’s a nice idea and maybe setAccessible() is smart enough to know whether the field is public or not… but FieldSerializer will always call it whether the field is already public or not. Not only that, the built in messages have always had private fields… and at least one of those is used internally to SM during connection setup, and always has been.

Whatever environment the poster is running in, it has not elevated the java.lang.reflect.ReflectPermission suppressAccessChecks permission.

I’m running it in a Java Applet, I’m not sending any messages. I don’t do anything with the connection after the try/catch block. So how do I fix it? Or is it a bug with jme3 itself?

There are messages sent back and forth to establish the connection. So simply connecting to the server will send a few messages.

I’m not sure what the best way to proceed is. I don’t know if its even possible to raise the permission level of an applet as it’s been so long since I messed with them. That would be the easiest way if its possible.

We could potentially fix this in JME but none of the options are particularly pleasant. As a work around, you could write your own serializer for the messages in question ( and DisconnectMessage) to use the getters/setters instead of direct field access. But that’s rather unpleasant on your end.

I think the right solution is to have JME fall back on the getters and setters when it is unable to reset the access of the field directly… but I have no time to make this change today.

Ok, thanks.

I’ll try using kryonet for now.