spring boot启动报错org.springframework.beans.factory.BeanCreationException

菜鸡庆 发布于 2018/08/24 21:23
阅读 10K+
收藏 0

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userInfoMapper' defined in file [F:\WorkSpace\spring-boot-shardingjdbc\target\classes\com\example\demo\mapper\UserInfoMapper.class]: Cannot resolve reference to bean 'testSqlSessionTemplate' while setting bean property 'sqlSessionTemplate'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'testSqlSessionTemplate' defined in class path resource [com/example/demo/config/DataSourceConfig.class]: Unsatisfied dependency expressed through method 'testSqlSessionTemplate' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/example/demo/config/DataSourceConfig.class]: Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shardingDataSource' defined in class path resource [com/example/demo/config/DataSourceConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'getShardingDataSource' threw exception; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown database 'user')

 

 

 

实在是不知道问题出在哪里,网上查了跟多有的说是依赖冲突,也有说是启动类使用

@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}),不加载热启动也试过,都没用  这是我配置错了吗
加载中
0
nonnetta
nonnetta

问题不是最后一句么。。。。

Cannot create PoolableConnectionFactory (Unknown database 'user')

返回顶部
顶部