MessageListener problems

Alright, trying to add a message listener to my client. Needless to say I keep getting this error:



[java]SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: com.jme3.network.Client.addMessageListener

at Client.Main.simpleInitApp(Main.java:68)

at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:225)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:207)[/java]







The place im using this is:



[java] @Override

public void simpleInitApp() {

System.out.println(“Attempting to connect to server…”);

try {

client = Network.connectToServer(“localhost”, 5000);

client.start();

Serializer.registerClass(MessageHandler.class);

client.addMessageListener(new ClientListener(), MessageHandler.class);

System.out.println(“Successfully connected to server.”);

connected = true;

createGui();

//Start startScreen = new Start(app);

} catch(IOException e) {

System.err.println(“Unable to connect to server.”);

connected = false;

}

Map newMap = new Map(app);

newMap.loadArea(“area1”);

newMap.physics();

flyCam.setMoveSpeed(50);

}[/java]



client.addMessageListener(new ClientListener(), MessageHandler.class); ← This is the line thats throwing the error… I can’t figure out why

ClientListener is an interface. You can’t just instantiate one, you have to implement it and instantiate your listener class. Also, it’s a little odd to have a message type called “MessageHandler”.



Have you looked at the networking tutorials or the TestChatClient and TestChatServer that come as part of the test suite?

Well I did look at the tutorials, but got stuck here lol. I’ll just read all the way through them and look at those tests