• Post Reply Bookmark Topic Watch Topic
  • New Topic

Root cause for this exception  RSS feed

 
harsha vardhanch
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends,


can you help me why the below exception would rise under which scenarios.....

ApplicationDispatcher[] Servlet.service() for servlet jsp threw exception java.lang.NullPointerException


i am able to see this exception when i am trying to access a jsp and i am unable to see any content in that and if i refresh the page it is again showing the data.....the application is hosted in tomcat.....

 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to post the JSP file you are accessing with stack trace ? May be the JSP page contains some scope variables which are coming from Servlet/Action classes ?
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just read the stacktrace (the 1st line points to the line where NPE is been thrown) and fix code accordingly.

You do understand when and why a NPE would be thrown, do you? It will happen when you access/invoke a reference which is null.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!