2

I'm getting this error with my Spring MVC sample application using Spring STS Eclipse plugin:

Class 'org.springframework.web.servlet.view.InternalResourceViewResolver' not found [config set: webninar-hello/web-context]servlet-context.xml

Anyone have an idea how to fix this?

6 Answers 6

8

I had this problem with a mistake in my maven configuration. As Ivan mentioned in his answer org.springframework.web.servlet-3.1.2.RELEASE.jar was not at my lib directory. So I searched for it's maven dependency from http://blog.springsource.org/2009/12/02/obtaining-spring-3-artifacts-with-maven/ URL.

Then I realized I included wrong dependency in my pom.xml correct dependency as follows

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

Previously I had spring-web as the artifactId. Hope this helps :)

1
  • In case you have this issue and you already have spring-webmvc added, just remove it and add it again. That fixed an issue in my case. Apr 19, 2015 at 13:04
5

I had the same problem and it wasn't a refreshing problem for me. I had to add the following jar to my build path:

org.springframework.web.servlet-3.1.2.RELEASE.jar

You can download the Spring bundle from the Spring website: http://www.springsource.org/spring-community-download

1
  • this worked for me as well. Why is no answer marked as correct?
    – Micha Roon
    Jul 28, 2012 at 15:24
4

Sounds like a refreshing problem.

F5, Cleanup Project, F5, Server Clean, maybe Server Clean Working directory.

If this all does not help. Remove the application from the server (close the window) and then add it again.

1
  • This worked for me, but only after I remembered to install m2e Maven plugin. eclipse.org/m2e
    – TalkLittle
    Feb 10, 2013 at 23:48
2

Just clean the project and check this dependency in your POM.xml file Definitely it will work fine.

     <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${spring.version}</version>
    </dependency>
1

I deleted everything under /Users//.m2/repository with rm -R * and then rebuilt everything with Maven>>Update Project, closed and reopened project, cleaned project and then it worked.

0

I had to add following dependencies to pom filefor resolve this issue.

    <dependency>
        <groupId>jstl</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>taglibs</groupId>
        <artifactId>standard</artifactId>
        <version>1.1.2</version>
        <scope>compile</scope>
    </dependency>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.