File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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 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(
at java.lang.Integer.parseInt(
at KKMultiServerThread.getHotel(

Can any one help me ?

Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

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.
I agree. Here's the link:
subject: java. lang. NumberFormatException ?
It's not a secret anymore!