When configuring spring’s XML file, you want to start component scanning. As a result, the following error occurred during the operation:
<?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">
<context:component-scan base-package="com.zxb"></context:component-scan>
</beans>
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 10 in XML document from class path resource [bean2.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 10; columnNumber: 52; CVC complex type. 2.4. C: wildcard matching is comprehensive, but the element cannot be found‘ context:component-scan ’A statement from the government.
After searching for a long time, it turned out that in the XML file, you need to specify the specific location of the schema file to be followed through the schemalocation mark>. I forgot to configure it, just add it.
<?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="com.zxb"></context:component-scan>
</beans>
It’s not detailed enough~
Read More:
- Use xx [‘xx ‘] = XX to set field value or does not support field: XXX
- Caused by: org.springframework.beans.factory.beancreationexception: error creating be
- Unable to read Scheme Document ‘ http://www.springframework.org/schema/beans/spring-beans-4.1.xsd ‘ [How to Fix]
- shiro Error org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type
- org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name
- Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of ty
- org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘use
- org.springframework.beans.factory.UnsatisfiedDependencyException
- Ora-02292: integrity constraint (XX) violated – child record found foreign key Association, record cannot be deleted
- appear org.springframework.beans . factory.BeanCreationException Causes and solutions of abnormal
- Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException
- “ XX.app ”It is damaged and cannot be opened. You should move it to the wastebasket.
- Error in project operation org.springframework.beans . factory.BeanCreationException : error creating bean with name can be configured by
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘serviceImpl‘
- Spring configuration error: org.springframework.beans . factory.BeanCreationException : Error creating bean with name ‘m
- ClobberError: The package ‘xxx‘ cannot be installed due to a path collision for ‘xx‘ This path alre
- AWS appasync error global.TYPE.xx
- main.cpp : (. Text + 0xd06): undefined reference to XX method | simple record
- When SSM + Maven project is running, it is prompted that org.springframework.web.servlet.dispatcherserservlet cannot be found
- Link: fatal error LNK1104: cannot open file “debug”/ xx.exe The question of