# Log4j的Unknown Source问题

1360人阅读 评论(0)

This seems to be related to how you compile your classes. In the javac task of my ant script for example, I must specify debug="true" if I want Tomcat to show line numbers in a stack trace:
<javac srcdir="${src.home}" destdir="${build.home}/WEB-INF/classes"
source="1.4"
target="1.4"
debug="on"
deprecation="false"
optimize="true"
excludes="test/**">
<classpath refid="compile.classpath"/>
</javac>

Zoe, luckily this should be fairly easy to fix. It looks like you are using Ant to build/package your project. You want to double check and make sure your <javac> task is setting the debug property to on AND including the 3 debuglevel arguments to provide full debugging information in your generated classes, so you don't get any of that 'unknown source' stuff going on.

个人资料
等级：
访问量： 57万+
积分： 7403
排名： 3622
最新评论
我的CSDN