Server load Spring configuration file Context:component-scan node not declared workaround

Source: Internet
Author: User
Tags jboss server

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.