• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NullPointerException, but no root cause

 
Alex Kravets
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get a NullPointerException from my jsp page but no root cause or line number, how can this be?


thanks,
Alex
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look in your logs, that's not a complete stack trace.
 
Alex Kravets
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but it is, I checked...
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try wrapping your entire scriptlet in a try/catch with e.printStackTrace() in the catch block
 
Alex Kravets
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I found the problem. But if I leave the line that produces error which is already in try/catch block, exception is still the same though -- incomplete.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
danny liu
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alex,

Sometimes, the error object is not an Exception but a Throwable. If you write
your code the following way, you may catch all the errors.

try{
}
catch(Throwable err){
logger.debug(err,err);
}

Dan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic