reset password
Author Message
JackStrauss
Posts: 236
Posted 17:18 Jan 24, 2013 |

I'm currently receiving an error that I can't resolve.

This is my error:

 

 
java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:504)
at java.lang.Integer.parseInt(Integer.java:527)
at servlet.CreateProjectNext.doPost(CreateProjectNext.java:46)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
 
 
I believe these lines of code are causing the error(s)t:
String fundingTarget, fundingDuration;
 
/*Relevant code*/
Integer.parseInt(fundingTarget),
Integer.parseInt(fundingDuration)
 
 
This is what I think the code will do: I think any numerical input will be parsed to strings.  
 
Am I correct in my assumption, or am I doing something wrong?
 
Also, Eclipse does not readily detect this error, but when I try to run it on the server, the error is detected.  Why does this happen?  
Last edited by JackStrauss at 17:19 Jan 24, 2013.
wilcoholic
Posts: 4
Posted 17:21 Jan 24, 2013 |

Looks like you are trying to parse an empty string to an Integer. I'd check to make sure that the variable you are trying to parse isn't empty.

tmyung
Posts: 11
Posted 17:22 Jan 24, 2013 |

are you entering a decimal, dollar sign or comma to your entry?

tmyung
Posts: 11
Posted 17:23 Jan 24, 2013 |
wilcoholic wrote:

Looks like you are trying to parse an empty string to an Integer. I'd check to make sure that the variable you are trying to parse isn't empty.

^ this makes more sense

JackStrauss
Posts: 236
Posted 17:26 Jan 24, 2013 |

Thanks to all. I'll take a look and see what I can do.

JackStrauss
Posts: 236
Posted 18:49 Jan 24, 2013 |

Actually....I figured out the problem....

This happens when you don't validate data, ha, ha.

Also, I had to refresh my browser.