Thank you JetBrains & IntelliJ IDEA: you just saved me hours of frustration
I've been using IDEA of 6 years now. Even so, I am still amazed and appreciative of the little touches in it. One such feature just saved me what would have likely been hours, if not a full day, of frustration. And it is a seemingly simple feature that would likely not even get discussed in a typical battle of the IDE's discussion.
I added a Servlet definition to my web app and ran it in my local Tomcat through IDEA. I received a ClassNotFoundExcpetion. But thanks to IDEA's extra little touch, I was able to quickly see why the class was not found:
Caused by: java.lang.NoClassDefFoundError: org/springframework/beans/factory/generic/GenericBeanFactoryAccessor
at org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping.determineUrlsForHandler(DefaultAnnotationHandlerMapping.java:113) [spring-webmvc-2.5.6.SEC01.jar:2.5.6.SEC01]
at org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping.detectHandlers(AbstractDetectingUrlHandlerMapping.java:79) [spring-webmvc-2.5.6.SEC01.jar:2.5.6.SEC01]
at org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping.initApplicationContext(AbstractDetectingUrlHandlerMapping.java:57) [spring-webmvc-2.5.6.SEC01.jar:2.5.6.SEC01]
at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119) [spring-context-3.0.1.RELEASE.jar:3.0.1.RELEASE]
at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:71) [spring-web-3.0.1.RELEASE.jar:3.0.1.RELEASE]
at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73) [spring-context-3.0.1.RELEASE.jar:3.0.1.RELEASE]
at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:99) [spring-context-3.0.1.RELEASE.jar:3.0.1.RELEASE]
at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:82) [spring-context-3.0.1.RELEASE.jar:3.0.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394) [spring-beans-3.0.1.RELEASE.jar:3.0.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1396) [spring-beans-3.0.1.RELEASE.jar:3.0.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) [spring-beans-3.0.1.RELEASE.jar:3.0.1.RELEASE]
Without IDEA's feature added notation of what libraries the various classes in the stack trace were coming from, I would not have so easily noticed that a spring 2.5.6 jar was being pulled into my spring 3.0.1 based project. With a standard stack trace, I would have been trying to figure out why the missing class was not being found in the spring-beans-3.0.1.RELEASE.jar which was clearly in my class path. But upon seeing that 2.5.6 library notated, a quick look at the maven dependency tree allowed me to add an <exclude> element to the dependency declaration for another library to stop it from pulling in the 2.5.6 jar (Maven was not auto detecting this since Spring significantly reworked their distribution files in Spring 3 and there is no spring-webmvc jar in Spring 3). Thanks to IDEA, I solved an issue in 5 minutes that would have likely frustrated me for hours otherwise.
When people ask me why I am willing to pay for IntelliJ IDEA when there are a couple of free alternatives, I will add this anecdote to the list of many I tell. In a matter of minutes today, IDEA paid for itself a dozen times over. Thanks IDEA. Thanks JetBrains. And thanks to the JetBrains developer that thought up this feature.
Please sign in to leave a comment.
Woah, what release of Idea are you using? I'm not seeing that extra detail and it's an awesome feature!
Hello Simon: I'm using the 9.0.2 EAP build 94.585.
IntelliJ is indeed very productive.
But that looks like a slf4j/logback stacktrace and it probably has nothing to do with IntelliJ...
Cristian... you are of course correct. I had jumped to a conclusion. I remember having recently read about that feature, but was thinking it was in some recent IDEA release notes. In reality it was when I was rereading info on Logback. I should have confirmed the feature was an IDEA feature before posting, but I let my excitement get ahead of me. D'oh! So I need to give credit to the correct folks and that is Logback. Thank you Cristian for the clarification, and for the polite way you did such. It's always a humbling experience to make an error on a public forum like this
It was still really useful to me, if that helps I'll be checking out LogBack on Monday...