Home > Back-end >  Excuse me about SpringBoot and tk. Mybaits integrated start-up failure problem
Excuse me about SpringBoot and tk. Mybaits integrated start-up failure problem

Time:09-27

Error message:
Java. Lang. An IllegalStateException: Failed to load ApplicationContext

Under Caused by: org. Springframework. Beans. Factory. UnsatisfiedDependencyException: Error creating bean with the name 'roleMapper defined in the file [E: \ projectCode/oa/target/classes/cn/oa/mapper \ roleMapper class] : Unsatisfied dependency expressed through the bean property' sqlSessionFactory '; Nested exception is org. Springframework. Beans. Factory. UnsatisfiedDependencyException: Error creating bean with the name 'sqlSessionFactory defined in the class path resource [tk/mybatis mapper/autoconfigure/MapperAutoConfiguration class] : Unsatisfied dependency expressed through method' sqlSessionFactory parameter 0; Nested exception is org. Springframework. Beans. Factory. BeanCreationException: Error creating bean with the name 'dataSource' defined in the class path resource [org/springframework/boot/autoconfigure/JDBC/DataSourceConfiguration $Hikari. Class] : bean instantiation via the factory method failed; Nested exception is org. Springframework. Beans. BeanInstantiationException: Failed to instantiate [com. Zaxxer. Hikari. HikariDataSource] : the Factory method 'dataSource' threw the exception. Nested exception is org. Springframework. Boot. Autoconfigure. JDBC. DataSourceProperties $DataSourceBeanCreationException: Failed to determine a suitable driver class

Under Caused by: org. Springframework. Beans. Factory. UnsatisfiedDependencyException: Error creating bean with the name 'sqlSessionFactory defined in the class path resource [tk/mybatis mapper/autoconfigure/MapperAutoConfiguration class] : Unsatisfied dependency expressed through method' sqlSessionFactory parameter 0; Nested exception is org. Springframework. Beans. Factory. BeanCreationException: Error creating bean with the name 'dataSource' defined in the class path resource [org/springframework/boot/autoconfigure/JDBC/DataSourceConfiguration $Hikari. Class] : bean instantiation via the factory method failed; Nested exception is org. Springframework. Beans. BeanInstantiationException: Failed to instantiate [com. Zaxxer. Hikari. HikariDataSource] : the Factory method 'dataSource' threw the exception. Nested exception is org. Springframework. Boot. Autoconfigure. JDBC. DataSourceProperties $DataSourceBeanCreationException: Failed to determine a suitable driver class

Under Caused by: org. Springframework. Beans. BeanInstantiationException: Failed to instantiate [com. Zaxxer. Hikari. HikariDataSource] : the Factory method 'dataSource' threw the exception. Nested exception is org. Springframework. Boot. Autoconfigure. JDBC. DataSourceProperties $DataSourceBeanCreationException: Failed to determine a suitable driver class

Under Caused by: org. Springframework. Boot. Autoconfigure. JDBC. DataSourceProperties $DataSourceBeanCreationException: Failed to determine a suitable driver class
spring start class comments:
@ SpringBootApplication
@ MapperScan (cn. Oa. "mapper")
Pom. XML configuration:
 & lt; Properties> 
Utf-8 & lt;/project. Build. SourceEncoding>
Utf-8 & lt;/project. Reporting. OutputEncoding>
1.8 & lt;/Java. Version>

2.1.5 & lt;/mapper. Start. Version>
8.0.19 & lt;/mysql. Version>
2.1.2 & lt;/mybatis. Spring - the boot. Starter>
1.18.12 & lt;/lombok. Version>
1.5.4 & lt;/spring - the boot. Maven. Plugin>




Org. Springframework. Boot
Spring - the boot - starter - web



Org. Springframework. Boot
Spring - the boot - starter - test



Mysql
Mysql connector - java
6.0.3 & lt;/version>
Runtime



Tk. Mybatis
Mapper - spring - the boot - starter
The ${mapper. Start. Version} & lt;/version>



Org. Projectlombok
Lombok
The ${lombok. Version} & lt;/version>


CodePudding user response:

Configuration file loaded failure?

CodePudding user response:

"Failed to determine a suitable driver class" database driver with the configuration file

CodePudding user response:

Profile name: application. Yml
Content:
Spring:
DataSource:
Url: JDBC: mysql://localhost: 3306/myoa
Username: root
Password: root
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related