• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Line Numbers in stack traces

 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 859
IBM DB2 Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic