The error message says that the problem is in the accept() method of the MyServer class, at line 41 of MyServer.java. Let's see that method, and tell us which is line 41; the problem will probably be obvious.

OK, well, the error means that MyServerSocket is null -- i.e., the actual ServerSocket object is not being created. Where does it get initialized? Is the code that initializes it still going to run in your new configuration?

Is about the worst thing you can do, especially as a beginner. An exception is a message that tells you about something important that's happening; an empty catch block tears that message up without even looking at it. At the very least, you want to say

} catch (IOException e) { e.printStackTrace(); }

In any case, since that variable is null, I can guarantee you that this will print something out, and it's going to tell you exactly what the problem is!

Changing the Exception type wont alter a thing - there is still a fundamental reason why your attempt to create an instance of ServerSocket is failing. in your catch block, try the following, and post the results it displays here for us to take a look at:

I believe what Henry means, is that you need to handle the exception if it is thrown. All you are doing is throwing the exception you are not actually saying what you want done incase of the exception.