• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java. lang. NumberFormatException ?

 
Zhixiong Pan
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
i try to realize multi client.my client fetch data from server using Socket, and server provide multithread to satisfy muliticlien.My first client can successfully get data from server, but clients after the first can not, and the server will paint:

java.lang.NumberFormatException: For input string: "le"
at java.lang.NumberFormatException.forInputString(NumberFormatException.
java:48)
at java.lang.Integer.parseInt(Integer.java:468)
at java.lang.Integer.parseInt(Integer.java:518)
at KKMultiServerThread.getHotel(KKMultiServerThread.java:36)
at KKMultiServerThread.run(KKMultiServerThread.java:75)

Can any one help me ?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The message seems explicit enough.
In getHotel(), you are trying to convert a String into an int,
but the String is not a number. Its value is actually "le".

Check the getHotel() function.
 
Zhixiong Pan
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Satou,
Thanks for your advice.I finally got the critical mistake and solved it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic