This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Tomcat Not Displaying Line Numbers on Exceptions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat Not Displaying Line Numbers on Exceptions" Watch "Tomcat Not Displaying Line Numbers on Exceptions" New topic
Author

Tomcat Not Displaying Line Numbers on Exceptions

Henry Lowell
Ranch Hand

Joined: May 29, 2006
Posts: 63
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.


Hank
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41060
    
  43
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).


Ping & DNS - my free Android networking tools app
Ray Stojonic
Ranch Hand

Joined: Aug 08, 2003
Posts: 326
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).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat Not Displaying Line Numbers on Exceptions
 
Similar Threads
Help getting Ant installed and to run
Setting Up Ant
Failed build : InstallTask cannot be found
Springapp Tutorial FileNotFoundException at Step 1.11, running ant deploy reload
This weeks Giveaway