mybatisplus中使用SqlRunner出错

本小妞迷上赌 提交于 2019-12-14 11:50:13

错误描述:

SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@739488d7] was not registered for synchronization because synchronization is not active
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@739488d7]
2019-12-14 11:29:18.044 ERROR 7620 --- [nio-8001-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause

java.lang.NullPointerException: null
    at org.apache.ibatis.session.defaults.DefaultSqlSession.close(DefaultSqlSession.java:263)
    at org.mybatis.spring.SqlSessionUtils.closeSqlSession(SqlSessionUtils.java:195)
    at com.baomidou.mybatisplus.extension.toolkit.SqlRunner.closeSqlSession(SqlRunner.java:234)
    at com.baomidou.mybatisplus.extension.toolkit.SqlRunner.selectList(SqlRunner.java:156)

错误解决:

public Object plugin(Object target) {
        logger.info("=========== plugin ================");
        return Plugin.wrap(target, this);
    }
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!