IntelliJ Spring Support "No view resolvers found"

Hello community!

I am a SpringMVC developer and am really loving IntelliJ's support for Spring. I have an archetype that defaults me with an InternalResourceViewResolver bean defined in one of the files configured in a fileset in my plugin.

However, in my @Controllers, I get a red error highlighting the name of my views that I return from my public methods. Hovering over the error yields the "No view resolvers found" message with little else to go on.

My app runs just fine via Jetty, just wondering how I can address this minor issue in IntelliJ?

Thanks in advance.

7 comments
Comment actions Permalink

Is your InternalResourceViewResolver defined in dispatcher-servlet.xml?

0
Comment actions Permalink

Nope. I tend to do everything via the context loader listener.

My general web.xml looks (something) like this:

<context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>classpath*:spring/*-config.xml</param-value>
</context-param>
<listener>
  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
…
<servlet>
  <servlet-name>springmvc</servlet-name>
  <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>/WEB-INF/spring/unused.xml</param-value>
    </init-param>
  <load-on-startup>1</load-on-startup>
</servlet>

I find that I get better results with this approach (especially when trying to mix in Spring Security which expects quite a lot of setup to be done in the ContextLoaderListener).

Is there a way to hint to IntelliJ it should look in the other bean files? Some magic tweak to the Spring fileset contents perhaps?

0
Comment actions Permalink

I see. This is the reason why Idea could not find that. Could you file a bug
to YouTrac? Hopefully it will be fixed soon.

"Josh Peters" <no_reply@jetbrains.com> сообщил(а) в новостях
следующее:29800419.49961302870699223.JavaMail.devnet@domU-12-31-39-18-36-57.compute-1.internal...

Nope. I tend to do everything via the context loader listener.

>

My general web.xml looks (something) like this:

>

<context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>classpath:spring/-config.xml</param-value>
</context-param>
<listener>

<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<servlet>
  <servlet-name>springmvc</servlet-name>

<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>/WEB-INF/spring/unused.xml</param-value>
    </init-param>
  <load-on-startup>1</load-on-startup>
</servlet>

>

I find that I get better results with this approach (especially when
trying to mix in Spring Security which expects quite a lot of setup to be
done in the ContextLoaderListener).

>

Is there a way to hint to IntelliJ it should look in the other bean files?
Some magic tweak to the Spring fileset contents perhaps?

>

---
Original message URL: http://devnet.jetbrains.net/message/5300664#5300664


0
Comment actions Permalink

Can you provide me (or point me in the direction of) an explanation as to what IntelliJ specifically looks for?

I've tried renaming my servlet and moving the -servlet.xml file to be in the default location containing an

<alias/>
to the view resolving bean with no luck.

I will submit a bug, but wouldn't mind finding a workaround too.
0
Comment actions Permalink

Unfortunately, the only way I see now is to place config containing the view
resolver in the default location.  сообщил(а) в новостях
следующее:30695486.50451302876015745.JavaMail.devnet@domU-12-31-39-18-36-57.compute-1.internal...

Can you provide me (or point me in the direction of) an explanation as to
what IntelliJ specifically looks for?

>

I've tried renaming my servlet and moving the -servlet.xml file to be in
the default location containing an <alias/> to the view resolving bean
with no luck.

>

I will submit a bug, but wouldn't mind finding a workaround too.

>

---
Original message URL: http://devnet.jetbrains.net/message/5300670#5300670


0
Comment actions Permalink

Hopefully the fix for this newly reported issue will answer my question.

http://youtrack.jetbrains.net/issue/IDEA-68202

0
Comment actions Permalink

Did you ever discover a workaround for this?

My web.xml file is very similar to yours, and I am trying to use a ResourceBundleViewResolver.  No matter where I put the declaration for my viewResolver, IntelliJ doesn't seem to pay any attention to it.

0

Please sign in to leave a comment.