2つの子モジュールを持つマルチモジュールMavenアプリがあります。1つのモジュールはWebサービス用で、もう1つはこれらのサービスを使用するシミュレーターです。
昨日開始したアプリケーションをデプロイしたいときに、Tomcat7から次のエラーが発生するという奇妙な問題があります。
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/application-context.xml]
そして、私のapplication-context.xmlsの上部セクションは次のようになります。
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<context:component-scan base-package="com.company">
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>
Springコンテキストの名前空間ハンドラーが見つからないということです。しかし、私は次のように私の親pom.xmlにその依存関係を持っています:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.1.2.RELEASE</version>
</dependency>
また、TomcatのWebアプリには、アプリケーションのlibフォルダーにspring-contextjarも含まれていることがわかります。私は2時間グーグルをしているので、助けていただければ幸いです。
ありがとう