2010 / 12 / 01

Quick tip for Intellij Idea users: manage your dependencies order

Recently I was developing project on top of Servlet API 3.0 and GWT 2.1 and faced the following problem: When I wanted to use async support from Servlet 3.0, Idea was unable to resolve method startAsync for HttpServletRequest.

Like this:

Resolving method failure

It turns out that gwt-dev-2.1.0.jar contains Servlet API 2.4 (looks like it comes with jetty or tomcat gwt dependencies) and Idea uses it for inspections and autocomplete.

Solution is simple: Check if servlet api 3.0 jar comes after gwt-dev-2.1.0.jar in yout project module dependencies (meta+; shortcut), like this:

Wrong dependency order

And swap them using “Move Up”|”Move Down” keys, than hit OK button. After that Idea will resolve Servlet API as expected:

Resolving method success

blog comments powered by Disqus