请教大神mybatis select数据一直报错,update,delete,insert数据都成功 5
Exceptioninthread"main"org.apache.ibatis.exceptions.PersistenceException:###Errorquer...
Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.apache.ibatis.reflection.ReflectionException: Error instantiating class cn.t.entity.User with invalid types () or values (). Cause: java.lang.NoSuchMethodException: cn.t.entity.User.<init>()
### The error may exist in cn/t/entity/UserMapper.xml
### The error may involve cn.t.domain.UserInterface.getUser-Inline
### The error occurred while setting parameters
### SQL: select id,name,password,email,address from user where id=?
### Cause: org.apache.ibatis.reflection.ReflectionException: Error instantiating class cn.t.entity.User with invalid types () or values (). Cause: java.lang.NoSuchMethodException: cn.t.entity.User.<init>()
at cn.t.test.testUse.main(testUse.java:29)
Caused by: java.lang.NoSuchMethodException: cn.t.entity.User.<init>()
at java.lang.Class.getConstructor0(Class.java:2810)
at java.lang.Class.getDeclaredConstructor(Class.java:2053)
at org.apache.ibatis.reflection.factory.DefaultObjectFactory.instantiateClass(DefaultObjectFactory.java:57)
... 22 more万分感谢 展开
### Error querying database. Cause: org.apache.ibatis.reflection.ReflectionException: Error instantiating class cn.t.entity.User with invalid types () or values (). Cause: java.lang.NoSuchMethodException: cn.t.entity.User.<init>()
### The error may exist in cn/t/entity/UserMapper.xml
### The error may involve cn.t.domain.UserInterface.getUser-Inline
### The error occurred while setting parameters
### SQL: select id,name,password,email,address from user where id=?
### Cause: org.apache.ibatis.reflection.ReflectionException: Error instantiating class cn.t.entity.User with invalid types () or values (). Cause: java.lang.NoSuchMethodException: cn.t.entity.User.<init>()
at cn.t.test.testUse.main(testUse.java:29)
Caused by: java.lang.NoSuchMethodException: cn.t.entity.User.<init>()
at java.lang.Class.getConstructor0(Class.java:2810)
at java.lang.Class.getDeclaredConstructor(Class.java:2053)
at org.apache.ibatis.reflection.factory.DefaultObjectFactory.instantiateClass(DefaultObjectFactory.java:57)
... 22 more万分感谢 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询