Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/mvc]

5 years ago by in Error, Spring, Web Application

Error

The web application fails to start due to the following error

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/mvc]

Solution

You need to have the JAR file: spring-webmvc-3.1.0.RELEASE.jar (or a newer version if available – check from here) in your web application classpath. If you are using Maven, simply add the following to your dependencies.

<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>spring-webmvc</artifactId>
  <version>3.1.0.RELEASE</version>
</dependency>

Make sure you also have the following dependencies in your classpath, as otherwise the web application may not start due to missing classes:

  • Spring Web JAR file: spring-web-3.1.0.RELEASE.jar
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
      <version>3.1.0.RELEASE</version>
    </dependency>
    
  • Hibernate Validator JAR file: hibernate-validator-4.3.0.Final.jar
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-validator-annotation-processor</artifactId>
      <version>4.3.0.Final</version>
    </dependency>
    
Albert Attard

Albert Attard is a Java passionate and technical lead at a research group. You can find him on . Over the past years Albert worked on various Java projects including traditional server/client applications, modular applications, large data handling applications and concurrent data manipulation applications to name a few. He has a BSc degree from the University of London (Homepage) and an MSc Information Security with the same university. His MSc thesis (Book) received the 2012 SearchSecurity.co.UK award (Website).

2 Responses to “Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/mvc]”


Sudheer
March 9, 2017 Reply

Thanks. Apparently I spent a few hours having misled by some of the other solutions.. this one helped

Albert Attard Albert Attard
March 12, 2017 Reply

I am glad that this article helped with your problem.

Leave a Comment


Time limit is exhausted. Please reload the CAPTCHA.