5 ms·
New tool helps debug Java exceptions faster
- arturnt 12y agoIf you are using Java with a package/build manager like maven you can always automatically pull all the source jars and then any IDE (Intellij/Eclipse) will allow you to jump through all third party libraries. Are you targeting the non-IDE crowd with this tool?
- jlebowskii 12y agoThe main use-case that I see for this is when an exception is thrown in production on some random server inside a third party library. Such exceptions can be excruciatingly hard to run down without the source code.
- sudowhodoido 12y agoHibernate comes to mind as a use case. That's always crapping huge stacks in production thanks to obscure edge cases.
- hrjet 12y agoWhile useful, I can't see how it could ensure that the right version of the source code is being presented to the user. In theory, it could analyse all versions of a library, and then choose only those versions that could lead to the given stack trace. Even that would be error prone, and may lead to multiple results. Setting up an IDE would take extra time, but would be the best way to debug the exception.
- jlebowskii 12y agoFinding the right version of the source code is definitely a challenge. However, it's a solvable one. What you're suggesting is actually what ExceptError does. It indexes all versions of each library, and uses context from the entire stack-trace, including line-numbers, method-names, etc, to find the exact match. Agree that IDE is the best way, especially when it comes to Java, but it's not always possible. For example you may be debugging distributed systems in production.
- jlebowskii 12y agoThe other thing is that even with an IDE, I think folks may find this useful. Not everyone uses Gradle, Maven, etc, and also not every library on Maven comes with the source jars.
- suyash 12y agoWhich IDE is it integrated with, cool feature but not a game changer.
- koko775 12y agoIf you want to use the feature in Eclipse, it's been around for at least a decade: http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fviews%2Fconsole%2Fref-stacktrace_console.htm http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse....
- jlebowskii 12y agoIt doesn't integrate with any IDE right now. As @arturnt noted, debugging and jumping to the right source code is generally not a problem when you're inside an IDE.
- alanfranzoni 12y agoEven when the error happens on the server and you're not inside an IDE, most of them (I'm sure Netbeans does it) allow you to paste the stacktrace from the production logs and makes classes/lines clickable, so you can enter the source code at the right points. It's more or less what your tool does on the web. Your tool may still be useful if some arcane third party app crashes, but how would you track the proper source code without info on dependencies' versions?
- lysium 12y agoReally helpful when debugging some random server! My bits: - Might want to mention the title of the file it is displaying. - What does "versions" do?
- jlebowskii 12y agoThanks! Good point, I'll look into adding that. "versions" tells you all the software versions which match, based on the context derived from the exception. For example, if you're unsure what version of Hadoop you're running, it'll tell you.
- mrspandex 12y agoThis reminds me of http://www.grepcode.com/ http://www.grepcode.com/, which I used a lot before I had an environment that auto-downloaded source. I really like that grepcode lets you see which version and what repository matches what you searched. It can make finding why something doesn't work in a particular released version of a library much easier.
- qwerta 12y agoHow do you handle multiple versions of the same jar files? Line numbers could be easily different across multiple versions. I have three suggestions: 1) each stack frame has method name. That could be used to filter out obvious errors. 2) provide selection between multiple versions if there are more options 3) let me upload POM, parse classpath or something.
- sitkack 12y agoI wrote one of these back in 2000. We had a huge WebLogic app with 10s if not more developers rotate in and out of it over many months. So I wrote a tool that did an n-gram search over the codebase and hyper link all of the lines in an exception trace to those files on viewcvs (now viewcv). Paste in a stack trace and immediately start navigating the source repo. I would have like to have made exception capture automatically submit it to the site so we could measure exception popularity. Edit: the ngram part was so that you could paste in random snippets of code and get hits in the version control store to start navigating. It was strictly needed for the exception hyperlinking.