我從Spring 3(3.1.2)和Google App Engine開始。元素的上下文沒有聲明:component-scan'
我跟着一個tutoria在線,現在,我有我的bean-realted 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.xsd
http://www.springframework.org/schema/context/
http://www.springframework.org/schema/context/spring-context.xsd">
<context:component-scan base-package="my.example">
其中所有的java文件的根包是 「my.example」。子包裝也是「模型」和「控制器」的子包裝。 現在。
當我啓動應用程序,我收回此錯誤:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 10 in XML document from ServletContext resource [/WEB-INF/spring-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:component-scan'.
有很多更堆棧跟蹤的。
有誰知道我該如何解決這個問題? 我檢查了XSD,他們似乎是正確的。
把-3.1的xsd不會改變什麼 – EsseTi 2012-07-11 20:28:18