Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-23-2007, 06:48 PM
Member
 
Join Date: Jul 2007
Posts: 26
osval is on a distinguished road
java.lang.NumberFormatException: For input stream:jav
I'm working on a Mail Client using SMTP protocol.
The code compiles fine but when I run the code with valid inputs and click the send button an exception appears

Code:
java.lang.NumberFormatException: For input stream:"jav".
any ideas?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-06-2007, 09:57 PM
bbq bbq is offline
Senior Member
 
Join Date: Jun 2007
Posts: 134
bbq is on a distinguished road
Can you paste your code?
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 08-07-2007, 04:50 PM
Member
 
Join Date: Jul 2007
Posts: 26
osval is on a distinguished road
I solved my problem!
in the line
Code:
int code = Integer.parseInt(reply.substring(0,3));
That has to be what's throwing the NumberFormat exception. I had to put a try block in there and return -1 if an exception is indeed thrown.

output the substring before you try to parse it so you can see exactly what it's trying to parse.

Last edited by osval : 08-07-2007 at 05:13 PM.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: NumberFormatException coco New To Java 1 08-07-2007 08:41 AM
Error: cannot resolve symbol' on Person (java.lang.String, java.lang.String) baltimore New To Java 1 08-06-2007 08:45 AM
how to take input and verify input in Java programs bilal_ali_java Advanced Java 0 07-21-2007 09:46 AM
java.lang.NumberFormatException: null Eric JavaServer Pages (JSP) and JSTL 1 07-05-2007 06:31 AM
stream redirection Ed New To Java 1 07-02-2007 05:34 PM


All times are GMT +3. The time now is 01:47 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org