Help with Head First Java simplechatclient -- NullPointerException
Rafael Szlom
Greenhorn
Joined: Jan 29, 2012
Posts: 2
posted
0
Hi gyus,
first time poster here.
I tried to run the sample code from chapter 18 / Head first Java and get the following error message.
Exception in thread "Thread-0" java.lang.NullPointerException at chatclient2.ChatClient2$MessageReader.run(ChatClient2.java:97)
at java.lang.Thread.run(Thread.java:722)
Here is the Full sourcecode
Could anyone please help me out. The problem lies in while((message = reader.readLine() != null) / Line 97
Don
Rajesh Nagaraju
Ranch Hand
Joined: Nov 27, 2003
Posts: 41
posted
0
If you run the program directly it gives first the following exception
you will not believe it , I did not start the method responsible for setting up the networking in the server code.
by the way that was exactly the same error message that I got .
subject: Help with Head First Java simplechatclient -- NullPointerException