Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Servlets and the fly likes java nullpointer exception error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "java nullpointer exception error" Watch "java nullpointer exception error" New topic

java nullpointer exception error

amol tanksale

Joined: Apr 22, 2013
Posts: 1
Hi all

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

after several refresh of (( 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 and 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

Joined: Mar 22, 2000
Posts: 13036
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.

Pongsakorn Semsuwan
Ranch Hand

Joined: May 15, 2011
Posts: 34

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.

A web application developer wannabe from Thailand
My StartUp :
Blog :
Pandey vijay

Joined: Oct 28, 2009
Posts: 4

Can you provide us log .

And you can test your servlet process using Debug mode .


Thanks and Regards
Vijay Pandey
Amit Ghorpade

Joined: Jun 06, 2007
Posts: 2851

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.

|Asking Good Questions|
I agree. Here's the link:
subject: java nullpointer exception error
It's not a secret anymore!