About the JBoss server startup, spring configuration file Loading error resolution method
The matching wildcard is strict, but no declaration can being found for element ' Context:component-scan '.
Spring Configuration file Code:
<!--- <base-package = "com.regaltec.gtfhr.* , cn.tisson.* "></context:component-scan> < base-package= "cn.tisson.train.*"></Context:component-scan >
Log file:
A: -: $,015INFO [STDOUT] -- ,- on A: -: $INFO Org.springframework.web.context.support.XmlWebApplicationContext Refreshing Org.springframework.web.conte[email protected]: Display name [Root Webapplicationcontext]; startup Date [Sat on A: -: $Cst -]; Root of context Hierarchy A: -: $,078INFO [STDOUT] -- ,- on A: -: $INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader Loading XML Bean definitions from class path res Ource [COM/regaltec/common/Config/Applicationcontext.xml] A: -: $, $INFO [STDOUT] -- ,- on A: -: $ERROR Org.springframework.web.context.ContextLoader Context Initialization Failedorg.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:Line452In XML document from class path resource [COM/regaltec/common/Config/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 forElement'Context:component-scan'.
This error occurs because the Xsi:schemalocation attribute value of the configuration Beans node in the Applicationcontext.xml file is missing
http://http://www.springframework.org/schema/context/spring-context-3.0.xsd
Example Project complete beans node properties are configured as follows:
<?XML version= "1.0" encoding= "UTF-8"?><Beansxmlns= "Http://www.springframework.org/schema/beans"Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"Xmlns:jee= "Http://www.springframework.org/schema/jee"XMLNS:AOP= "HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP"Xmlns:tx= "Http://www.springframework.org/schema/tx"Xmlns:context= "Http://www.springframework.org/schema/context"xsi:schemalocation= "Http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/ Spring-beans-2.5.xsd Http://www.springframework.org/schema/jee Http://www.springframework.org/schema/jee/sp Ring-jee-2.5.xsd HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP http://www.springframework.org/schema/aop/spring -aop-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2. 5.xsd Http://www.springframework.org/schema/context Http://www.springframework.org/schema/context/spring-co Ntext-2.5.xsd ">
Server load Spring configuration file Context:component-scan node not declared workaround