无法找到春天 NamespaceHandler XML模式 命名空间 [http://www.springframework.org/schema/context]春3.0 - 无法找到春天NamespaceHandler为XML架构命名空间的背景下
SEVERE: Exception sending context initialized event to listener instance of
class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate NamespaceHandler for namespace
[http://www.springframework.org/schema/context]
Offending resource: ServletContext resource [/WEB-INF/HelloWorld-service.xml]
这是我的HelloWorld-service.xml中:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
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/util
http://www.springframework.org/schema/util/spring-util-3.0.xsd"
default-autowire="byName">
<context:component-scan base-package="com.test.service">
<context:include-filter type="annotation"
expression="org.springframework.stereotype.Service"/>
</context:component-scan>
在我的pom.xml我有:
<properties>
<spring.version>3.0.5.RELEASE</spring.version>
</properties>
........
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
项目树形结构:
任何想法可能是这个原因吗?
尝试从pom.xml的 – Arpit 2015-04-06 14:26:15
@Arpit去除 org.springframework 春天上下文 $ {} spring.version 。我试过兄弟。但没有运气:( –
Unknown
2015-04-06 16:06:45
你有类路径上的任何其他弹簧罐,即在应用程序服务器库文件夹的某处? – Setu 2015-04-09 16:25:51