File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

java nullpointer exception error

amol tanksale
Greenhorn

Joined: Apr 22, 2013
Posts: 1
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

Joined: Mar 22, 2000
Posts: 12781
    
    5
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

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 : http://www.dreamlog.co
Blog : http://pongsakornsemsuwan.wordpress.com
Pandey vijay
Greenhorn

Joined: Oct 28, 2009
Posts: 4

Can you provide us log .

And you can test your servlet process using Debug mode .

Enjoy


Thanks and Regards
Vijay Pandey
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

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.


SCJP, SCWCD.
|Asking Good Questions|
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: java nullpointer exception error