I used Tomcat to deploy the WAR package without using and introducing the Alibaba/Druid data source, but problems like this still occurred when starting:
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration': Unsatisfied dependency expressed through field 'properties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'spring.datasource.dynamic-com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: com/alibaba/druid/wall/WallConfig
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration': Unsatisfied dependency expressed through field 'properties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'spring.datasource.dynamic-com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: com/alibaba/druid/wall/WallConfig
(note: everything is fine with SpringBoot's built-in Web container)
Expected Result:
Up and running
Actual Result:
Start the error
Enviroment
Windows10 + Maven3 + Tomcat9.0.16 + MySQL5.7 DatasourceType: com.zaxxer.hikari.HikariDataSource DriverClassName: com.mysql.cj.jdbc.Driver JDK Version(required): v1.8 SpringBoot Version(required): v2.1.4 Starter Version(required): v2.5.3
Describe
I used Tomcat to deploy the WAR package without using and introducing the Alibaba/Druid data source, but problems like this still occurred when starting:
(note: everything is fine with SpringBoot's built-in Web container)
Expected Result: Up and running Actual Result:
Start the error
Steps to reproduce
Step 1
Step 2
Step 3