Article reference: : {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)
Okay, the error is reported as above. We know that the error is like this. When I first saw this error, I was attracted by: null. I thought it was impossible. What is null? . . I went to Baidu directly, and of course there was no result. .
Keep reading and get attracted again. . .
: 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:
This error made me firmly think that I wrote something wrong, so I understood the first sentence: There was an error in querying the database, and the null pointer was exception!
Regarding the problem of querying the database null pointer, I went to Baidu and couldn't find the reason.
Well, miracles always happen when you are desperate. . .
: {dataSource-1} init error
The error reported in the first line finally attracted my attention!
Go to Baidu and say there is something wrong with my database configuration:
I didn't troubleshoot, so I just found a correct configuration information and copied it and used it, and then it was fine
=
=jdbc:mysql://localhost:3306/javaee?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone = GMT
=root
=root
=debug
=8088
-path=/
-aliases-package=
Very confused? I'm really confused. . .