• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

exception

 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Answered here https://coderanch.com/t/571442/Servlets/java/exception
 
rakhi sinha
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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);
 
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic