私は春を使用しています3.2.3.RELEASEと依存関係を引き出すためのmaven。 Eclipseでプロジェクトを構築する場合、次の取得していますエラー:一致するワイルドカードは厳密ですが、要素 'context:component-scan'の宣言が見つかりません
Exception in thread "main" org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 17 in XML document from class path resource [META-INF/spring/application-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 17; columnNumber: 64; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:component-scan'.
マイappication-のcontext.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:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context/
http://www.springframework.org/schema/context/spring-context-3.2.xsd">
<context:component-scan base-package="com.example" />
私は私のMavenの依存関係が示すように、正しいjarファイルを引っ張っていますことを知っています::私は私の瓶の中の右スキーマ宣言を持っていることがわかりますMETA-INF/sping.schemasインサイド
http\://www.springframework.org/schema/context/spring-context-2.5.xsd=org/springframework/context/config/spring-context-2.5.xsd
http\://www.springframework.org/schema/context/spring-context-3.0.xsd=org/springframework/context/config/spring-context-3.0.xsd
http\://www.springframework.org/schema/context/spring-context-3.1.xsd=org/springframework/context/config/spring-context-3.1.xsd
http\://www.springframework.org/schema/context/spring-context-3.2.xsd=org/springframework/context/config/spring-context-3.2.xsd
http\://www.springframework.org/schema/context/spring-context.xsd=org/springframework/context/config/spring-context-3.2.xsd
私も無駄にこれらを見てきました:
The matching wildcard is strict, but no declaration can be found for element 'tx:annotation-driven'
No declaration can be found for element 'context:component-scan'
The matching wildcard is strict, but no declaration can be found for element 'context:component-scan
助けてください、それは私が狂いそうです。.. .. :(
ありがとうございました。それも見ていない。その最終的な "/"を取り除くと、そのトリックはそれらの依存関係を整理することになります。 – Ithar
同じもの。最後にこの '/'を使って同じチュートリアルをコピー/ペーストする必要があります –