IDEA 导入springboot源码,更改配置之后,报错
来源:13-2 SpringBoot的搭建与启动
慕娘6525119
2021-01-05
我只改了appllication.prorperties,把数据库改成了本地
但是单元测试这显示No beans of AreaDao,之前也有同学问过,但是他们说这个不影响项目运行,但是我这个单元测试有问题,我不知道是数据库连接的问题还是这的问题
运行单元测试报错
可是datasource这应该是没问题吧
2回答
-
建议同学在没有具备相关解决问题的能力之前,不要使用最终源码,因为这里你用的是明文的数据库帐号密码,实际你看咱们注释里面用的是密文,所以需要用密文才可以
详见
http://coding.imooc.com/lesson/144.html#mid=7986
00 -
慕娘6525119
提问者
2021-01-05
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'o2oApplication': Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration': Unsatisfied dependency expressed through method 'setConfigurers' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'transactionManagementConfiguration': Unsatisfied dependency expressed through field 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [com/imooc/o2o/config/dao/DataSourceConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.mchange.v2.c3p0.ComboPooledDataSource]: Factory method 'createDataSource' threw exception; nested exception is java.lang.RuntimeException: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher
00
相似问题