Hello,
I have been working on a simple server application, and within that application I have two threads. One that listens for new user connections, and one that listens for messages sent by each of the users. However, the first thread starts perfectly fine, and the second thread shows no signs of starting at all.

This is the code I use to create and start the threads:
Code:
console.println("Creating connection listener...");
		
//Create connection listener
Thread connectionListenerThread = new Thread(new ConnectionListener(), "ConnectionListener");
connectionListenerThread.start();

console.println("Created connection listener!");

console.println("Creating server thread...");

//Create server thread
Thread serverThread = new Thread(new ServerThread(), "ServerThread");
serverThread.start();

console.println("Creaded server thread!");
This is my ConnectionListener class:
Code:
package com.arkazex.chatserv.thread;

import java.io.IOException;

import com.arkazex.chatserv.Main;
import com.arkazex.chatserv.events.NewConnection;

public class ConnectionListener implements Runnable{

	@Override
	public void run() {
		while(true) {
			try {
				NewConnection.create(Main.ssocket.accept());
			} catch (IOException e) {
				Main.console.println("[SEVERE] An IO error occurred while attempting to connect a new client");
			}
		}
	}

	
}
And this is my ServerThread class
Code:
package com.arkazex.chatserv.thread;

import com.arkazex.chatserv.Main;
import com.arkazex.chatserv.User;
import com.arkazex.chatserv.Users;
import com.arkazex.chatserv.events.MessageReceived;

public class ServerThread implements Runnable{

	@Override
	public void run() {
		Main.console.println("OUTPUT!!!");
		//Retrieve an array containing a list of all currently connected users
		User[] users = (User[]) Users.users.values().toArray();
		while(true) {
			
			Main.console.println("I betcha this will print");
			//Itterate through the array and check for incomming messages
			for(int i = 0; i < users.length; i++) {
				String message = users[i].getPacket();
				if(!message.equals(null)) {
					MessageReceived.received(message, users[i]);
				}
				Main.console.println("User " + i + ": " + users[i].getNickname());
			}
			Main.console.println("There's a users in these parts");
			
		}
	}

}
EDIT: I added some debug code, and it seems that the second thread is immediately terminated, only Half the time. As in, when I run the program, half the time it will return "RUNNABLE" and the other half it will return "TERMINATED". The thread does not run in either circumstance however.