mybatisplus中使用SqlRunner出錯


錯誤描述:

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);
    }


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM