(Unknown Source) in Exception stack trace
This is normally related to missing debug information. You are probably using JRE (not JDK), which does not include debug information for rt.jar classes. Try using full JDK, you'll get proper locations in the stack trace:
Exception in thread "main" java.lang.NullPointerException
at java.lang.String.<init>(String.java:177)
at java.lang.String.valueOf(String.java:2840)
at StringValueOfNull.main(StringValueOfNull.java:3)
Why do I see unknown source in stack traces when I have sources downloaded?
Java libraries can be compiled with debug information that includes the source file and the line number information. A lot of libraries are compiled with this information, but apparently HSQLDB is compiled without that information (probably because this results in slightly smaller class files).
The availability of this information has nothing to do with you having downloaded the sources or not, this only depends on how the classes in the library JAR were compiled.
Looking at the files available in Maven specifically for HSQLDB, it seems that using <classifier>debug</classifier>
in your Maven dependency may well use a version of the library that does include this debug information. However, I haven't verified this.
Unknown Source in java stack trace, yet line numbers are in the class file
I think the correct way is:
<javac debug="true" debuglevel="lines,vars,source"
Note there are no spaces between lines,vars,source
Why does my servlet stacktrace show Unknown Source for my classes?
Tomcat cannot provide you more detailed information unless the classes in question were compiled with debugging information. Without this debugging information, the JVM cannot determine what line of code the error occurred on.
Edit: You can ask the compiler to include this information by specifying the -g
option when running javac
on the command line. You can also specify this option using the debug
parameter of the Javac Ant task.
Related Topics
What Are the Differences Between "Generic" Types in C++ and Java
How to Tune Tomcat 5.5 Jvm Memory Settings Without Using the Configuration Program
How to Determine If a List Is Sorted in Java
Differencebetween Jdk Dynamic Proxy and Cglib
Convert a Date Format in Epoch
Java: What's the Big-O Time of Declaring an Array of Size N
How to Make Anonymous Inner Classes in Java Static
How to Fix "Unsupported Class File Major Version 60" in Intellij Idea
Using Gson to Parse a JSON Array
Which Is the Best Alternative for Java Serialization
Cannot Find Firefox Binary in Path. Make Sure Firefox Is Installed
Why Does This Generic Code Compile in Java 8
Java.Util.Concurrentmodificationexception Not Thrown When Expected
Registering and Using a Custom Java.Net.Url Protocol
Java Interfaces Methodology: Should Every Class Implement an Interface
Java Error: "Your Security Settings Have Blocked a Local Application from Running"