• Post Reply Bookmark Topic Watch Topic
  • New Topic

Line Numbers in stack traces  RSS feed

 
Stan Lederer
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've written a servlet. It's giving me a NullPointerException:

I'm trying to figure out which line in doSearch is breaking. It can't be line 87 in SolrServlet.java because that line is a comment line. Line 31 is the correct line, though, where doSearch calls doGet.

Is there a technique for correctly determining the line number from a stack trace?

Thanks.
 
William P O'Sullivan
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It may be that what you are actually running does not match your source.

This can happen if the source that you are looking at has not been compiled and packaged, or deployed correctly.

WP
 
Stan Lederer
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William P O'Sullivan wrote:It may be that what you are actually running does not match your source.

This can happen if the source that you are looking at has not been compiled and packaged, or deployed correctly.

WP

I make it a point to restart tomcat after I put the newly built .class file into my webapps/servlet directory. What else might I need to check or do?
 
Campbell Ritchie
Marshal
Posts: 56587
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Repeat the procedure until you get the same Exception, and you might get a different line number now you have recompiled the code.
 
Stan Lederer
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Issue was PBCK (problem between chair and keyboard.) I had two copies of the class file and I started putting the class file into the wrong directory. Sorry for the false alarm and thanks for the help.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!