2

I was wanting to dig into the details of an exception I was getting running unit tests but the stack trace parts for HSQLDB show as Unknown Source. I am using Maven and I have sources and documents downloaded and I can see them defined correctly in the IDE.

Any ideas why I would still see Unknown Source?

Caused by: org.hsqldb.HsqlException: incompatible data type in operation
at org.hsqldb.error.Error.error(Unknown Source)
at org.hsqldb.error.Error.error(Unknown Source)
at org.hsqldb.NumberSequence.setDefaults(Unknown Source)
at org.hsqldb.NumberSequence.<init>(Unknown Source)
at org.hsqldb.ParserTable.readColumnDefinitionOrNull(Unknown Source)
at org.hsqldb.ParserTable.readTableContentsSource(Unknown Source)
at org.hsqldb.ParserTable.compileCreateTableBody(Unknown Source)
at org.hsqldb.ParserTable.compileCreateTable(Unknown Source)
at org.hsqldb.ParserDDL.compileCreate(Unknown Source)
at org.hsqldb.ParserCommand.compilePart(Unknown Source)
at org.hsqldb.ParserCommand.compileStatements(Unknown Source)
at org.hsqldb.Session.executeDirectStatement(Unknown Source)
at org.hsqldb.Session.execute(Unknown Source)
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
sproketboy
  • 8,967
  • 18
  • 65
  • 95
  • Does this answer your question? [(Unknown Source) in Exception stack trace](https://stackoverflow.com/questions/3132302/unknown-source-in-exception-stack-trace) – Lino Mar 10 '21 at 13:10

1 Answers1

5

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.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
  • You rock! That worked. I didn't know about the classifier setting. Thanks – sproketboy Mar 10 '21 at 13:24
  • 1
    @sproketboy Classifiers are library specific; HSQLDB specifically has a `hsqldb-2.5.1-debug.jar` (see https://repo1.maven.org/maven2/org/hsqldb/hsqldb/2.5.1/), which means you can retrieve that library by specifying the appropriate classifier (the part between `hsqldb-2.5.1-` and `.jar`) – Mark Rotteveel Mar 10 '21 at 13:28
  • Thanks! Regretfully, my company did not added those to private repository. Well, that's my point. – coffman21 Aug 03 '23 at 18:10
  • @coffman21 Usually there is a team supporting it which can configure it also download these files, hopefully they can help with that. – Mark Rotteveel Aug 04 '23 at 07:42
  • @mark-rotteveel Fair point, but it was an order of magnitude faster to replace jar in local repo. Thanks anyways – coffman21 Aug 28 '23 at 14:06