File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes NULL Pointer Exception. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "NULL Pointer Exception." Watch "NULL Pointer Exception." New topic

NULL Pointer Exception.

Samantha O'Neil

Joined: Mar 30, 2005
Posts: 17
On my servlet program I'm calling a file(given in HTML with herf action)whichgo to server and that server file pick up data from particular table(which determined previously) and show its data. But as I performed click on one line given with herf in herfHTML shows error of NULL Pointer Exception. Why It all this? Tell me where I'm wrong. tomcat server is in functioning.
Neeraj Dheer
Ranch Hand

Joined: Mar 30, 2005
Posts: 225

Can you post some part of the code and the entire Exception??
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15081

As with any exception: Look at the stack trace of the exception. It shows you exactly in which line of code in which source file the exception happened. Go to that place in your source code and think what could be null there.

More info: How to resolve a java.lang.NullPointerException

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: NULL Pointer Exception.
It's not a secret anymore!