问题
在mybatis的单元测试中,通过调用如下代码:
User user = sqlSession.selectOne("com.iotek.mapper.UserMapper.findUserById",5);
然后报错信息如下:
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.apache.ibatis.reflection.ReflectionException: Error instantiating class com.iotek.model.User with invalid types () or values (). Cause: java.lang.NoSuchMethodException: com.iotek.model.User.<init>()
### The error may exist in com/iotek/mapper/UserMapper.xml
### The error may involve com.iotek.mapper.UserMapper.findUserById-Inline
### The error occurred while setting parameters
### SQL: select * from user WHERE id=?
### Cause: org.apache.ibatis.reflection.ReflectionException: Error instantiating class com.iotek.model.User with invalid types () or values (). Cause: java.lang.NoSuchMethodException: com.iotek.mod