Restarting client connection after disconnecting


I’m working on a MMORPG and have a problem with starting the client after it’s closed due to disconnecting ([java]client.close()[/java])

I’m getting this error, but can’t find a way to fix it:

at java.lang.Thread.start(
at com.noblesofvictory.client.ClientMain.connect(
at com.noblesofvictory.client.MenuController.connect(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at de.lessvoid.nifty.NiftyMethodInvoker.callMethod(
at de.lessvoid.nifty.NiftyMethodInvoker.performInvoke(
at de.lessvoid.nifty.Nifty$DelayedMethodInvoke.perform(
at de.lessvoid.nifty.Nifty.invokeMethods(
at de.lessvoid.nifty.Nifty.handleDynamicElements(
at de.lessvoid.nifty.Nifty.access$1700(
at de.lessvoid.nifty.Nifty$NiftyInputConsumerImpl.processEvent(
at de.lessvoid.nifty.Nifty$NiftyInputConsumerImpl.processMouseEvent(
at com.jme3.niftygui.InputSystemJme.handleMouseEvent(
at com.jme3.niftygui.InputSystemJme.onMouseButtonEventQueued(
at com.jme3.niftygui.InputSystemJme.forwardEvents(
at de.lessvoid.nifty.Nifty.update(
at com.jme3.niftygui.InputSystemJme.endInput(
at com.jme3.input.InputManager.processQueue(
at com.jme3.input.InputManager.update(
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(

i bet you have to create a client for each connection, they are not reusable. This doens’t mean that you have to restart the software of the client (human) just that you need to create a new instance of the client (class) and use it.

But your problem is maybe here : at com.noblesofvictory.client.ClientMain.connect(

(but, hey, without code the best thing i can do is guess)

1 Like

I had already tried that, but it still gives the same error:

public void disconnect() {
try {
client = Network.connectToServer(ConnectionInfo.NAME,
} catch (IOException e) {
Logger.getLogger(ClientMain.class.getName()).log(Level.SEVERE, null, e);
MessageInitializer.InitializeMessages(client, list);

Which line gives the error? I assume this line

client = Network.connectToServer(ConnectionInfo.NAME,

No sorry, that post was a bit vague. The error occurs when reconnecting to the server using [java]client.start()[/java].

ok well, if the thread is already started, you cannot start it again. You have to create a new thread, or change the values inside it (if you didn’t stop it). You cannot call start on a running thread.

I’ve got it working, thanks for the information. I made a mistake in the Auth handling when the password/ussername was wrong, so it didn’t call the disconnect method.