The first one appears to be missing the external library. Make sure you add the library on the classpath when invoking it (or as a part of the manifest if its jar'd). It also appears to not be able to invoke the main method on com.spilka.server.ChatServer.
The second is simply caused by a non-instance of an object which you are attempting to dereference. To what depth, we don't know you'll need to trace the stack to get to the cause. So within the main, you can follow the tack to the q and find that something is being derferenced which is null. Perhaps the argument itself is null. It can be try/caught since its an Exception to prevent the program from terminating, but that only has use if you have a fallback to go on (which chances are would be an error message and then exit anyway).
Maybe an example of that would help.
Integer myint = null;
myint = Integer.parseInt("anint");
catch (NumberFormatException ex)
// this is guaranteed to get here since 'anint' isn't parseable as an Integer.
System.out.println(myint.toString()); // throws NullPointerException since toString isn't available on null.