• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

java nullpointer exception error

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 34
Eclipse IDE Java
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 4
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you provide us log .

And you can test your servlet process using Debug mode .

Enjoy
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic