This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes org.apache.jasper.JasperException: java.lang.NullPointerException error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "org.apache.jasper.JasperException: java.lang.NullPointerException error" Watch "org.apache.jasper.JasperException: java.lang.NullPointerException error" New topic
Author

org.apache.jasper.JasperException: java.lang.NullPointerException error

lisy jessica
Ranch Hand

Joined: Oct 27, 2010
Posts: 47
Hi am getting the following error while running my webapp




Please can anyone help me out. Thanks in advance.

Thanks,
Lissy
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

pay attention to your exception stack trace ...
J. Kevin Robbins
Bartender

Joined: Dec 16, 2010
Posts: 823
    
  13

You can ignore the first 6 lines. Line 12 is the key to solving this one. If you can't figure it out, post your code for UserDAO.java and we'll give you another hint.

"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
shivam singhal
Ranch Hand

Joined: Jul 15, 2012
Posts: 215

NULL POINTER EXCEPTION ,, that is your providing response to client ,, and information is NOT RECEIVE by the client ..

check out your code where you are providing final output to client.. the name of the variable whose information you want to be visible to your client,, maches the name of the variable in ABOVE CODE you have store the information..
Raja gopal Mani
Greenhorn

Joined: Jan 23, 2013
Posts: 12
You must be using a com.nic.sample.dao.UserDAO object in your jsp having null value on it

Try to handle the null value on your jsp ...

It may give a better understanding to others if you paste the jsp code here, thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60740
    
  65

IF you have Java code inside your JSP, you are doing it wrong. Please see this JspFaq entry.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
lisy jessica
Ranch Hand

Joined: Oct 27, 2010
Posts: 47
Hi My jsp page listuser.jsp




UserDAO.java





I am sorry for the late reply, I still can't fix it,
J. Kevin Robbins
Bartender

Joined: Dec 16, 2010
Posts: 823
    
  13

Without being able to run your code, my best guess is that you are not getting a resultset back on line 70, but it's not obvious to me why. I would set a breakpoint just prior to that line and debug into it to see what's going on.
J. Kevin Robbins
Bartender

Joined: Dec 16, 2010
Posts: 823
    
  13

btw, where are you closing the connection? Each of those try-catch blocks should be a try-catch-finally, and the finally block is where you close the statement, the resultset, and the connection.
lisy jessica
Ranch Hand

Joined: Oct 27, 2010
Posts: 47
Thanks all for the help! I debugged it...got it now. I didn't add oracle jar files. Now it's working. Thanks a lot for the help.
 
jQuery in Action, 2nd edition
 
subject: org.apache.jasper.JasperException: java.lang.NullPointerException error
 
Similar Threads
SQL Exception :general error
Trying to connect to SQL-2005 with JDBC and JNDI
NEWBIE question on created test client in Eclipse
HTTP Status 500 - when testing Crystal report for an Integration with Maximo
Unable to compile class for JSP