Results 1 to 4 of 4
  1. #1
    Jazzperson is offline Member
    Join Date
    Mar 2009
    Posts
    7
    Rep Power
    0

    Unhappy 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..:(
    Attached Files Attached Files

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    So the error is on line 43 of the Entry class, this line:
    Java Code:
    p = Integer.parseInt((String)port.get(i));
    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.

  3. #3
    Jazzperson is offline Member
    Join Date
    Mar 2009
    Posts
    7
    Rep Power
    0

    Default

    You are absolutely right - there was a mistake in the XML-file which i corrected now.. Thank you.. You have been a great help..:)

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

Similar Threads

  1. Exception java.lang.NumberFormatException
    By vasavi.singh in forum New To Java
    Replies: 3
    Last Post: 02-24-2009, 06:27 AM
  2. NumberFormatException problem
    By bluebarca in forum New To Java
    Replies: 1
    Last Post: 02-06-2009, 07:39 AM
  3. Error: NumberFormatException
    By coco in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 07:41 AM
  4. JDOM in java applications
    By boy22 in forum Advanced Java
    Replies: 1
    Last Post: 08-02-2007, 05:38 PM
  5. java.lang.NumberFormatException: null
    By Eric in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 07-05-2007, 05:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •