Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

exception

 
archana tiwari
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

How to remove this exception


type Exception report

message

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

exception

java.lang.NullPointerException
LoginExample.Generatepdf.doPost(Generatepdf.java:125)
LoginExample.Generatepdf.doGet(Generatepdf.java:30)
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.
 
Neeraj Dhiman
Ranch Hand
Posts: 68
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think, this excepting occur if there is null in your jsp. not exactly. check your jsp for this.
hope this will help.
 
Maneesh Godbole
Saloon Keeper
Posts: 11070
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
archana tiwari wrote:
How to remove this exception


type Exception report

message

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

exception

java.lang.NullPointerException
LoginExample.Generatepdf.doPost(Generatepdf.java:125)
LoginExample.Generatepdf.doGet(Generatepdf.java:30)
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.


You can "remove this exception" by ensuring you are not invoking a method on null references. That is what the stack trace essentially means.
So what do you have on Generatepdf.java:125
 
Manjunath Gajula
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put try catch and see while executing what piece of code, it is throwing null pointer.
<%try{
%> your JSP code should come here.
<%}catch(Exception e) {
%>
<%e.printStackTrace();%>

 
Tim Moores
Bartender
Posts: 2855
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that by using GET and POST interchangeably you're violating the HTTP specification. What's more, a login -which presumably involves sending a password- should never be done over GET.

Manjunath Gajula wrote:your JSP code should come here.

It's servlet code, not JSP code, as the stack trace shows.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic