配置问题:用于[http://www.springframework.org/schema/mvc]的Spring NamespaceHandler [英] Configuration problem:Spring NamespaceHandler for [http://www.springframework.org/schema/mvc]

查看:91
本文介绍了配置问题:用于[http://www.springframework.org/schema/mvc]的Spring NamespaceHandler的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

配置问题:无法为XML模式命名空间[http://www.springframework.org/schema/mvc]找到Spring NamespaceHandler.

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

谁能说出为什么会发生此错误? 这是我的配置.

can anyone tell why this error is happening? this is my configuration.

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans 
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-3.0.xsd
        http://www.springframework.org/schema/mvc 
        http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">

推荐答案

@Tijo

您需要检查几件事:

  1. 您使用的Spring版本是否为3.0.您在配置中指的是spring-beans-3.0.xsd,spring-context-3.0.xsd和spring-mvc-3.0.xsd,因此您需要使用Spring 3.0.* JAR.

  1. Whether the Spring version you are using is 3.0. You are referring to spring-beans-3.0.xsd, spring-context-3.0.xsd and spring-mvc-3.0.xsd in your configuration, so you need to use Spring 3.0.* JARs.

通过在构建路径中添加外部JAR,您可能已经在构建路径中具有了所有必需的JAR,最有可能是参考库".您还需要将所有JAR保留在Web应用程序的WEB_INF/lib/文件夹中(将它们直接放在该文件夹中,而不是放在WEB-INF/lib/的子文件夹中).只有这样,您的Web服务器才能知道它们.这就是博zh的意思.

You may already have all the required JARs in the build path, most likely as "Referenced libraries" by adding external JARs to your build path. You also need to keep all the JARs in the webapp's WEB_INF/lib/ folder (put them in that folder directly, and not in a sub-folder of WEB-INF/lib/). Only then your web server knows about them. This is what Bozho means.

这更加微妙.确保您的WEB-INF/lib文件夹中没有多个Spring JAR版本.

This is more subtle. Make sure you do not have multiple Spring JAR versions in your WEB-INF/lib folder.

这些也是检查其他NameSpaceHandler错误的相同步骤,例如

These are the same steps one needs to check for other NameSpaceHandler errors too, like

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

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

希望有帮助!

这篇关于配置问题:用于[http://www.springframework.org/schema/mvc]的Spring NamespaceHandler的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆