Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www

来源:互联网 发布:淘宝如何排名靠前 编辑:程序博客网 时间:2024/06/04 23:24

原文连接: http://www.javacreed.com/unable-to-locate-spring-namespacehandler-for-xml-schema-namespace-httpwww-springframework-orgschemamvc/   


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

Albert Attard is a Java passionate and technical lead at a research group. You can find him onGoogle+. 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).

  • Published: 69 posts
  • Web: http://www.javacreed.com

0 0