SSM integration occurs when org.springframework.beans.factory.BeanCreationException:Error creating bean with Name ' XXX ' The cause of the exception and how to resolve it (only the following may occur, not all)
This exception is: Injection Bean failed exception, that is, the injected bean could not be found.
There are several possible reasons for this:
1.bean not annotated or annotated error
2. When the project is integrated, jar package conflicts
3. The ' XXX ' configuration has errors
Solution: 1,3 carefully check is that most of the people on the Internet should be 2 of this error, I should also be such a mistake, but do not know which jar package conflict, the simplest solution to direct the other person's pom.xml to use is (genius solution)
POM. Xml:
<project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"
xsi:schemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" >
<modelVersion>4.0.0</modelVersion>
<groupId>com.wantao</groupId>
<artifactId>SSM-CRUD</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>ssm-crud Maven webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<!--Https://mvnrepository.com/artifact/org.mybatis.generator/mybatis-generator-core--
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!--Spring-mvc, spring-->
<!--HTTPS://MVNREPOSITORY.COM/ARTIFACT/ORG.SPRINGFRAMEWORK/SPRING-WEBMVC--
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.3.7.RELEASE</version>
</dependency>
<!--https://mvnrepository.com/artifact/org.springframework/spring-test--
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>4.3.7.RELEASE</version>
<scope>test</scope>
</dependency>
<!--JSR303 data verification,
Import Hibernate-validator
TOMCAT7 the following server, El expression, additional to the server's LIB package to replace the new standard el-->
<!--Https://mvnrepository.com/artifact/org.hibernate/hibernate-validator--
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.4.1.Final</version>
</dependency>
<!--paged Query plugin--
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>5.0.0</version>
</dependency>
<!--return support for JSON strings--
<!--Https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind--
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.8</version>
</dependency>
<!--Spring JDBC Transaction Management--
<!--HTTPS://MVNREPOSITORY.COM/ARTIFACT/ORG.SPRINGFRAMEWORK/SPRING-JDBC--
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.3.7.RELEASE</version>
</dependency>
<!--Spring-oriented programming--
<!--https://mvnrepository.com/artifact/org.springframework/spring-aspects--
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>4.3.7.RELEASE</version>
</dependency>
<!--Mybatis-jar Package--
<!--Https://mvnrepository.com/artifact/org.mybatis/mybatis--
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.2</version>
</dependency>
<!--MyBatis Integrated Spring Adapter Pack--
<!--https://mvnrepository.com/artifact/org.mybatis/mybatis-spring--
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.1</version>
</dependency>
<!--database connection pool, drive-
<!--https://mvnrepository.com/artifact/c3p0/c3p0--
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.1.2 </version>
</dependency>
<!--Https://mvnrepository.com/artifact/mysql/mysql-connector-java--
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.41</version>
</dependency>
<!--Jstl servlet-api-->
<!--Https://mvnrepository.com/artifact/jstl/jstl--
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!--Https://mvnrepository.com/artifact/javax.servlet/servlet-api--
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>RELEASE</version>
</dependency>
</dependencies>
<build>
<finalName>SSM-CRUD</finalName>
</build>
</project>
Org.springframework.beans.factory.BeanCreationException:Error creating Bean with Name ' XXX ' exception when SSM integration causes and workarounds