• mybatis报错invalid types () or values ()解决方法


     

    原因: Pojo类User没提供无参数构造方法, 加上该构造方法后,问题解决

    ### Cause: org.apache.ibatis.reflection.ReflectionException: 
    Error instantiating class com.chry.browserServer.db.model.User with invalid types () or values (). 
    cause: java.lang.NoSuchMethodException: com.chry.browserServer.db.model.User.<init>()] with root cause
    
    java.lang.NoSuchMethodException: com.chry.browserServer.db.model.User.<init>()
        at java.lang.Class.getConstructor0(Class.java:2849) ~[na:1.7.0_67]
        at java.lang.Class.getDeclaredConstructor(Class.java:2053) ~[na:1.7.0_67]
        at org.apache.ibatis.reflection.factory.DefaultObjectFactory.instantiateClass(DefaultObjectFactory.java:57) ~[mybatis-3.2.1.jar:3.2.1]
        at org.apache.ibatis.reflection.factory.DefaultObjectFactory.create(DefaultObjectFactory.java:45) ~[mybatis-3.2.1.jar:3.2.1]
        at org.apache.ibatis.reflection.factory.DefaultObjectFactory.create(DefaultObjectFactory.java:38) ~[mybatis-3.2.1.jar:3.2.1]
        at org.apache.ibatis.executor.resultset.FastResultSetHandler.createResultObject(FastResultSetHandler.java:387) ~[mybatis-3.2.1.jar:3.2.1]
        at org.apache.ibatis.executor.resultset.FastResultSetHandler.createResultObject(FastResultSetHandler.java:366) ~[mybatis-3.2.1.jar:3.2.1]
        at org.apache.ibatis.executor.resultset.FastResultSetHandler.getRowValue(FastResultSetHandler.java:266) ~[mybatis-3.2.1.jar:3.2.1]
        at org.apache.ibatis.executor.resultset.FastResultSetHandler.handleRowValues(FastResultSetHandler.java:221) ~[mybatis-3.2.1.jar:3.2.1]
        at org.apache.ibatis.executor.resultset.FastResultSetHandler.handleResultSet(FastResultSetHandler.java:193) ~[mybatis-3.2.1.jar:3.2.1]
        at org.apache.ibatis.executor.resultset.FastResultSetHandler.handleResultSets(FastResultSetHandler.java:159) ~[mybatis-3.2.1.jar:3.2.1]
        at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:57) ~[mybatis-3.2.1.jar:3.2.1]
        at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:70) ~[mybatis-3.2.1.jar:3.2.1]
        at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:57) ~[mybatis-3.2.1.jar:3.2.1]
        at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:259) ~[mybatis-3.2.1.jar:3.2.1]
        at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:132) ~[mybatis-3.2.1.jar:3.2.1]
        at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:105) ~[mybatis-3.2.1.jar:3.2.1]
        at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81) ~[mybatis-3.2.1.jar:3.2.1]
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104) ~[mybatis-3.2.1.jar:3.2.1]
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:98) ~[mybatis-3.2.1.jar:3.2.1]
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:62) ~[mybatis-3.2.1.jar:3.2.1]
    。。。 。。。。
  • 相关阅读:
    Jquery 总结的几种常用操作
    Mybatis 一对多
    HTML 子父窗口 iframe 超时 返回首页
    Struts 标签
    Spring + Mybatis 基于注解的事务
    机器学习实战-数据探索(变量变换、生成)
    机器学习实战-数据探索(变量变换、生成)
    Pandas matplotlib 无法显示中文 Ubuntu16.04
    Pandas matplotlib 无法显示中文 Ubuntu16.04
    Intel MKL FATAL ERROR: Cannot load libmkl_avx2.so or libmkl_def.so.
  • 原文地址:https://www.cnblogs.com/chry/p/5877535.html
Copyright © 2020-2023  润新知