文章借鉴: : {dataSource-2} init error
2019-03-26 22:37:31.021 ERROR 13308 --- [ main] : {dataSource-1} init : null
at $(:325) ~[na:1.8.0_181]
at (:357) ~[na:1.8.0_181]
at (:581) ~[druid-1.1.:1.1.6]
at (:815) [druid-1.1.:1.1.6]
at (:1221) [druid-1.1.:1.1.6]
at (:1217) [druid-1.1.:1.1.6]
at (:90) [druid-1.1.:1.1.6]
at (:157) [spring-jdbc-5.1.:5.1.]
at (:115) [spring-jdbc-5.1.:5.1.]
at (:78) [spring-jdbc-5.1.:5.1.]
at (:82) [mybatis-spring-1.3.:1.3.2]
at (:68) [mybatis-spring-1.3.:1.3.2]
at (:338) [mybatis-3.4.:3.4.6]
at (:84) [mybatis-3.4.:3.4.6]
at (:62) [mybatis-3.4.:3.4.6]
at (:326) [mybatis-3.4.:3.4.6]
at (:156) [mybatis-3.4.:3.4.6]
at (:109) [mybatis-3.4.:3.4.6]
at (:83) [mybatis-3.4.:3.4.6]
at (:148) [mybatis-3.4.:3.4.6]
at (:141) [mybatis-3.4.:3.4.6]
at (:77) [mybatis-3.4.:3.4.6]
at .invoke0(Native Method) ~[na:1.8.0_181]
at (:62) ~[na:1.8.0_181]
at (:43) ~[na:1.8.0_181]
at (:498) ~[na:1.8.0_181]
at $(:433) [mybatis-spring-1.3.:1.3.2]
at .$(Unknown Source) [na:na]
at (:166) [mybatis-spring-1.3.:1.3.2]
at (:83) [mybatis-3.4.:3.4.6]
at (:59) [mybatis-3.4.:3.4.6]
at .$(Unknown Source) [na:na]
at (:24) [test-classes/:na]
at .invoke0(Native Method) ~[na:1.8.0_181]
at (:62) ~[na:1.8.0_181]
at (:43) ~[na:1.8.0_181]
at (:498) ~[na:1.8.0_181]
at $(:50) [junit-4.:4.12]
at (:12) [junit-4.:4.12]
at (:47) [junit-4.:4.12]
at (:17) [junit-4.:4.12]
at
: nested exception is :
### Error querying database. Cause:
### The error may exist in com/leyou/mapper/ (best guess)
### The error may involve
### The error occurred while executing a query
### Cause:at (:77)
at $(:446)
at .$(Unknown Source)
at (:166)
at (:83)
at (:59)
at .$(Unknown Source)
at (:24)
at .invoke0(Native Method)
at (:62)
at (:43)
at (:498)
好了,报错如上,我们知道了错误是这样的,我在刚看到这个错误地时候,就被: null给吸引了,觉得不可能呀,哪里为null了。。。就直接去百度了,结果当然是没结果了。。
继续往下看,然后又被吸引了。。。
: nested exception is :
### Error querying database. Cause:
### The error may exist in com/leyou/mapper/ (best guess)
### The error may involve
### The error occurred while executing a query
### Cause:
这个错误让我坚定的认为我哪里写错了,就理解了第一句:查询数据库出错,空指针异常!
对于查询数据库空指针的问题,又去百度了一通,没找到原因。
好了,绝望的时候总是会出现奇迹的。。。
: {dataSource-1} init error
第一行的报错终于引起了我这个沙雕的注意!
再去百度,说我的数据库配置的有问题:
我没有排查,直接找了一个正确的配置信息复制黏贴过来就用了,然后就没事了
=
=jdbc:mysql://localhost:3306/javaee?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone = GMT
=root
=root
=debug
=8088
-path=/
-aliases-package=
很懵?我真的很懵。。。