Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java nullpointer exception error

 
amol tanksale
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

from web.xml I am trying to call servelt (home.java) which call to home.jsp.. thay displays some datacount and some list on jsp.

after several refresh of ((home.page)) .......page cant display with error java nullpointer exception on console

index.jsp--->servelt--->home.jsp( call to DBmethod from home.jsp for count=refresh multiple time)-->blank page.


Majore thing is on eclipse i see error that point to dbaccess.java and home.java servelet.

why its display data only few times and after that blank page

can anybody tell me whs the problem,
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, my crystal ball is in the shop for the 10,000 vision checkup so you will have to do this yourself:

The stack trace for the NPE should tell you where to look. If it refers to the servlet which the JSP was compiled into, find the servlet code under the work directory.

Bill
 
Pongsakorn Semsuwan
Ranch Hand
Posts: 34
Eclipse IDE Java
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We need your log to investigate the problem. The log will tell you which line it get Null Pointer Exception.

This Null Pointer Exception is occur when we try to access something in null object.
For example, myCar.turnRight() will cause a Nul Pointer Exception if myCar is null.

With this info, try to figure out why your object becomes null when you refresh the page.
 
Pandey vijay
Greenhorn
Posts: 4
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you provide us log .

And you can test your servlet process using Debug mode .

Enjoy
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pandey vijay wrote:And you can test your servlet process using Debug mode .

That is not a good idea. It may cause timeouts on the browser.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic