spring boot启动报错org.springframework.beans?400报错-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

spring boot启动报错org.springframework.beans?400报错

爱吃鱼的程序员 2020-06-06 15:38:17 142

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}),不加载热启动也试过,都没用  这是我配置错了吗
Java Spring
分享到
取消 提交回答
全部回答(1)
  • 爱吃鱼的程序员
    2020-06-06 15:38:29
                        <p>问题不是最后一句么。。。。</p>
    

    Cannot create PoolableConnectionFactory (Unknown database 'user')

    0 0
开发与运维
使用钉钉扫一扫加入圈子
+ 订阅

集结各类场景实战经验,助你开发运维畅行无忧

推荐文章
相似问题
推荐课程