Results 1 to 4 of 4
- 03-08-2009, 07:25 PM #1
Member
- Join Date
- Mar 2009
- Posts
- 7
- Rep Power
- 0
XML JDOM XPATH NumberFormatException
Hi Experts..:)
My head is about to explode..:eek: The attached little piece of code has been working succesfully, but suddently it results in a NumberFormatException:
java.lang.NumberFormatException: For input string: ""
java.lang.NumberFormatException.forInputString(Unk nown Source)
java.lang.Integer.parseInt(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
Entry.doGet(Entry.java:43)
javax.servlet.http.HttpServlet.service(HttpServlet .java:617)
javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
I really hope some one can give me a clue, how to solve the problem..:(
-
So the error is on line 43 of the Entry class, this line:
and instead of a number, you're getting an empty String "". I'd use either a debugger or a bunch of println(...) methods to find out the state of your program when the error occurs. You should be able to tell which line of the XML is tripping the error.Java Code:p = Integer.parseInt((String)port.get(i));
- 03-08-2009, 08:14 PM #3
Member
- Join Date
- Mar 2009
- Posts
- 7
- Rep Power
- 0
You are absolutely right - there was a mistake in the XML-file which i corrected now.. Thank you.. You have been a great help..:)
-
Similar Threads
-
Exception java.lang.NumberFormatException
By vasavi.singh in forum New To JavaReplies: 3Last Post: 02-24-2009, 06:27 AM -
NumberFormatException problem
By bluebarca in forum New To JavaReplies: 1Last Post: 02-06-2009, 07:39 AM -
Error: NumberFormatException
By coco in forum New To JavaReplies: 1Last Post: 08-07-2007, 07:41 AM -
JDOM in java applications
By boy22 in forum Advanced JavaReplies: 1Last Post: 08-02-2007, 05:38 PM -
java.lang.NumberFormatException: null
By Eric in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 07-05-2007, 05:31 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks