Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

exception

 
rakhi sinha
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hoe to remove this exception


HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.NumberFormatException: null
java.lang.Integer.parseInt(Integer.java:415)
java.lang.Integer.parseInt(Integer.java:497)
LoginExample.Generatepdf.doPost(Generatepdf.java:123)
LoginExample.Generatepdf.doGet(Generatepdf.java:29)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.32 logs.

 
Hemanth Mummadi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You must be trying to parse null somewhere in your servlet. Check that out. Information provided by you was insufficient, you can paste the code snippet which is causing this issue.
 
Maneesh Godbole
Saloon Keeper
Posts: 11196
15
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
rakhi sinha
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hemanth Mummadi wrote:You must be trying to parse null somewhere in your servlet. Check that out. Information provided by you was insufficient, you can paste the code snippet which is causing this issue.



int i=1;
int t_cost=0;
while (rs.next())
{
String s = new Integer(i).toString();
table.addCell(s);
b1=rs.getString("I");
b2=rs.getString("IT");
table.addCell(b1+" and "+b2);
b3=rs.getString("Q");
table.addCell(b3);
b5=rs.getString("P");
table.addCell(b5);

i=i+1;
}
table.setSpacingAfter(30);
document.add(table);
String str= String.valueOf(t_cost);
table.setHorizontalAlignment(Element.ALIGN_LEFT);

p12.setAlignment(Element.ALIGN_RIGHT);
 
Tim Moores
Bartender
Posts: 2955
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll have to examine the values that you're passing into the parseInt method; it seems they are not all integers (or maybe null).
 
Hemanth Mummadi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Agree with Tim. Check what are you passing in b5 and b3. It is safe to have null checks before you parse something or you should be catching NumberFormatException.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic