我使用的是日食,當我嘗試運行在開發模式我的春天GWT應用解析applicationContext.xml文件時,我得到以下異常:XML錯誤運行時,在開發模式彈簧GWT應用
Ignored XML validation warning
org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/tx/spring-tx-3.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.warning(ErrorHandlerWrapper.java:96)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:380)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
(...)
Context initialization failed
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 51 in XML document from ServletContext resource [/WEB-INF/applicationContext.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 'tx:annotation-driven'.
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
而且我applicationContext.xml文件開頭是這樣的:
<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"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
(...) 線51 ---><tx:annotation-driven transaction-manager="transactionManager"/>
是否任意子呃知道發生了什麼?
你知道,我有一個這樣的問題,幾個星期前,這個來自Spring的。我最終做的是從POM開始:(我認爲你的POM存在問題(我有一個問題),也許你的maven-war-plugin正確地導出了所有的.jar文件,但你的gwt插件不能。指出你的戰爭目標,並建立目錄,看看他們是否得到spring-tx。希望你找到自己的方式! –
2011-03-30 14:55:41
你能告訴我究竟在哪裏以及我要檢查什麼嗎?因爲我認爲爲了在開發模式下運行它,沒有必要創造一場戰爭(那個,或者我看不到任何地方!) 感謝您的幫助,併爲我的新手問題感到抱歉! – Neets 2011-03-30 15:21:36