jQuery in Action, 2nd edition*
The moose likes Beginning Java and the fly likes java. lang. NumberFormatException  ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "java. lang. NumberFormatException  ?" Watch "java. lang. NumberFormatException  ?" New topic

java. lang. NumberFormatException ?

Zhixiong Pan
Ranch Hand

Joined: Jan 25, 2006
Posts: 239
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.
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é

Joined: Nov 24, 2005
Posts: 14687

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.

[My Blog]
All roads lead to JavaRanch
Zhixiong Pan
Ranch Hand

Joined: Jan 25, 2006
Posts: 239
Hi Satou,
Thanks for your advice.I finally got the critical mistake and solved it.
jQuery in Action, 2nd edition
subject: java. lang. NumberFormatException ?
Similar Threads
My way for multi-client failed?
Two Dimensional array declaration in Java
Servlet.service() for servlet jsp threw exception
problematic run-time errors
How close am I in getting this program right?