無法找到春天 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