SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4529fa91]

控制台日志如下

DEBUG - Creating a new SqlSession
DEBUG - SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4529fa91] was not registered for synchronization because synchronization is not active
DEBUG - Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4529fa91]

并没有看出错误原因是什么,可以断定是SQL语句那里的,随即在SQL语句上加上try catch查看

try {
    dao.saveWithKey("com.test.mapper.SingleWindowVehicleMapper.addSheet2", body);
} catch (Exception e) {
    e.printStackTrace();
}

catch查看异常如下

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression 'createDate != null''. Cause: org.apache.ibatis.ognl.ExpressionSyntaxException: Malformed OGNL expression: createDate != null' [org.apache.ibatis.ognl.TokenMgrError: Lexical error at line 1, column 20.  Encountered:  after : ""]

检查mapper.xml果然这里有问题

#{createDate},

 

你可能感兴趣的:(Mybatis)