2012-03-20 23 views
1

私は、次のしているが、私のdispatcher-servlet.xmlSpring MVCの3.1 - 名前空間のエラー

<?xml version="1.0" encoding="UTF-8"?> 
<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" 
     xmlns:util="http://www.springframework.org/schema/util" 
     xmlns:beans="http://www.springframework.org/schema/beans" 
     xsi:schemaLocation="http://www.springframework.org/schema/mvc 
          http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd 
          http://www.springframework.org/schema/beans 
          http://www.springframework.org/schema/beans/spring-beans-3.1.xsd 
          http://www.springframework.org/schema/context 
          http://www.springframework.org/schema/context/spring-context-3.1.xsd 
          http://www.springframework.org/schema/util 
          http://www.springframework.org/schema/util/spring-util-3.1.xsd"> 

にXML検証が無効なコンテンツが要素 ':コンポーネント・スキャン・コンテキスト' で始まる見つかった

を言って失敗しました。 '{"http://www.springframework.org/schema/mvc":argument-resolvers、" http://www.springframework.org/ schema/mvc ":return-value-handler}'が必要です。

私は http://www.springframework.org/schema/mvc/で定義されたスキーマをチェックして、すべてが罰金のようです。以前私はSpring MVC 3.0を使用していましたが、問題は発生しませんでした。私はすべてのjarファイルを直接WEB-INF/libに持っています。何か案は?

更新

これは検証が<context:component-scan base-package="com" />を失敗したラインであるとはい使用されているすべてのjarファイルはあなたが、

+0

バージョン3.1のすべての瓶はありますか? – Ralph

+0

@skaffman:情報を提供するための質問を更新しました – Raghav

答えて

4

が間違っている可能性春3.1からですが、スキーマを見て、エラーが与えられました<context:component-scan base-package="com" />要素を<mvc:annotation-driven> </mvc:annotation-driven>タグ内に配置しようとしたか、または<mvc:annotation-driven>タグを閉じるのを忘れていましたか?コンポーネントスキャンをタグの外側に配置するか、<mvc:annotation-driven>タグを適切に閉じます。

+0

ありがとうございます。はい、私はを閉じるのを忘れていました。愚かな私。私は30分以上問題が何かを把握しようとしていました。私の目をチェックしました:P – Raghav