I'm using Intellij IDEA. How do I "view source" for xerces stacktrace that is used by scala.xml?
I have to debug a project that uses scala.xml from Scala 2.8.1. A bug that I have presents the following stacktrace (irrelevant parts omitted):
--- more xerces stacktrace lines ---
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at scala.xml.factory.XMLLoader$class.loadXML(XMLLoader.scala:40)
at scala.xml.XML$.loadXML(XML.scala:40)
at scala.xml.factory.XML开发者_开发百科Loader$class.loadString(XMLLoader.scala:59)
at scala.xml.XML$.loadString(XML.scala:40)
at pt.cnbc.wikimodels.util.SBMLHandler.wrapHTML(SBMLHandler.scala:99)
I'm using Intellij IDEA and I would like to click on the stacktrace line and go to the source even in the lines that currently say "Unknown Source".
Note that:
- the XML file that gives the error is valid (and big)
- I only call XML.loadString after obtaining the content of the file
- I don't mind doing something that escapes IDEA realm if you have a different "idea". :)
Lines that say Unknown Sources
come from files that are missing debug info. In this case Xerces
. IntelliJ has nothing to do with it. What you could do (but I haven't tried it) is to get sources for Xerces and recompile them insuring that debug info is included. Then use resulting jar in your classpath.
The failure occurred deep inside Xerces. If you want to examine the source code where the failure occurred, you need to install the source code of Xerces and tell IntelliJ where to find it, by putting it on your source path.
(I wouldn't be confident that this is the right strategy for solving your problem, but that's up to you.)
精彩评论