hwxjava
hwxjava
采纳率58.3%
2020-12-27 22:57 阅读 115
已采纳

spring boot整合mybatis时报空指针异常

java.lang.NullPointerException: null
	at com.alibaba.druid.wall.WallProvider.checkInternal(WallProvider.java:701) ~[druid-1.1.17.jar:1.1.17]
	at com.alibaba.druid.wall.WallProvider.check(WallProvider.java:578) ~[druid-1.1.17.jar:1.1.17]
	at com.alibaba.druid.wall.WallFilter.checkInternal(WallFilter.java:793) ~[druid-1.1.17.jar:1.1.17]
	at com.alibaba.druid.wall.WallFilter.check(WallFilter.java:788) ~[druid-1.1.17.jar:1.1.17]
	at com.alibaba.druid.wall.WallFilter.statement_execute(WallFilter.java:421) ~[druid-1.1.17.jar:1.1.17]
	at com.alibaba.druid.filter.FilterChainImpl.statement_execute(FilterChainImpl.java:2956) ~[druid-1.1.17.jar:1.1.17]
	at com.alibaba.druid.filter.FilterAdapter.statement_execute(FilterAdapter.java:2474) ~[druid-1.1.17.jar:1.1.17]
	at com.alibaba.druid.filter.FilterEventAdapter.statement_execute(FilterEventAdapter.java:188) ~[druid-1.1.17.jar:1.1.17]
	at com.alibaba.druid.filter.FilterChainImpl.statement_execute(FilterChainImpl.java:2956) ~[druid-1.1.17.jar:1.1.17]
	at com.alibaba.druid.filter.FilterAdapter.statement_execute(FilterAdapter.java:2474) ~[druid-1.1.17.jar:1.1.17]
	at com.alibaba.druid.filter.FilterEventAdapter.statement_execute(FilterEventAdapter.java:188) ~[druid-1.1.17.jar:1.1.17]
	at com.alibaba.druid.filter.FilterChainImpl.statement_execute(FilterChainImpl.java:2956) ~[druid-1.1.17.jar:1.1.17]
	at com.alibaba.druid.proxy.jdbc.StatementProxyImpl.execute(StatementProxyImpl.java:147) ~[druid-1.1.17.jar:1.1.17]
	at com.alibaba.druid.pool.vendor.MSSQLValidConnectionChecker.isValidConnection(MSSQLValidConnectionChecker.java:50) ~[druid-1.1.17.jar:1.1.17]
	at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1384) ~[druid-1.1.17.jar:1.1.17]
	at com.alibaba.druid.pool.DruidDataSource.shrink(DruidDataSource.java:3056) ~[druid-1.1.17.jar:1.1.17]
	at com.alibaba.druid.pool.DruidDataSource$DestroyTask.run(DruidDataSource.java:2793) ~[druid-1.1.17.jar:1.1.17]
	at com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2777) ~[druid-1.1.17.jar:1.1.17]

项目可以启动,而且隔几秒这个相同的异常又多一个

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    qq_38402364 暴躁码农 2020-12-28 15:22

    驱动包和数据库版本匹配么?

    com.mysql.jdbc.Driver 是 mysql-connector-java 5及5之前的,

    com.mysql.cj.jdbc.Driver 是 mysql-connector-java 6及6之后的。

    对照下吧

    点赞 1 评论 复制链接分享

相关推荐