• 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

Tomcat Not Displaying Line Numbers on Exceptions

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Tomcat 5.0.28 and jdk1.4. I am compiling and deploying with Ant 1.6. When I deploy an app to Tomcat and there is an exception in my code I am not getting the line number displayed. I'll get something like:

java.lang.NullPointerException
at com.app.persistence.jdbc.JdbcUserDAO.manageUser(Unknown Source)

Is there some compiler setting I need to adjust to make these show up? Is it possible to set this with the ant task?

Thanks.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For the line number to be printed, the code needs to have been compiled with the debug flag on. If this is code acquired commercially, then that will most likely not be the case (which doesn't hurt much, since you wouldn't have the source anyway). If it is something you have the source for, then you can recompile it using the debug flag (I think it's called -g).
 
Ranch Hand
Posts: 326
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I ran into this same problem when I started using Ant to build my webapps.

Yes, you must tell the javac task that you want the 'extra' information:

Currently, I have debug set to true and debuglevel set to lines,source,vars (pretty much wide open).
 
My previous laptop never exploded like that. Read this tiny ad while I sweep up the shards.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic