java.lang.RuntimeException: java.sql.SQLException: Cannot create cn.gqp.domain.Account: cn.gqp.domai
java.lang.RuntimeException: java.sql.SQLException: Cannot create cn.gqp.domain.Account: cn.gqp.domain.Account Query: select * from account where id = ? Parameters: [6]
at cn.gqp.dao.impl.AccountDaoImpl.findAccountById(AccountDaoImpl.java:22)
at cn.gqp.service.impl.AccountServiceImpl.findAccountById(AccountServiceImpl.java:15)
at cn.gqp.testSpring.testFindAccountById(testSpring.java:14)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.sql.SQLException: Cannot create cn.gqp.domain.Account: cn.gqp.domain.Account Query: select * from account where id = ? Parameters: [6]
at org.apache.commons.dbutils.AbstractQueryRunner.rethrow(AbstractQueryRunner.java:392)
at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:351)
at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:289)
at cn.gqp.dao.impl.AccountDaoImpl.findAccountById(AccountDaoImpl.java:20)
… 24 more
Process finished with exit code -1
上面的原因是实体类没有无参构造!
上一篇: 实现记录某实体的最后修改时间和操作人id
下一篇: mybatis生成实体类
推荐阅读
-
java查询mysql时报“java.sql.SQLException:Cannot create ..(类名)”原因
-
使用QueryRuner出现java.sql.SQLException: Cannot create com.pojo.User:异常
-
java.lang.RuntimeException: Cannot create an instance of class com.xxx.xxxViewModel
-
java.sql.SQLException: Cannot create com.orzxlee.d_generic.Student 异常
-
jboss中调用webservice时报java.lang.RuntimeException: Cannot create a secure XMLInputFactory的异常
-
使用QueryRunner报错:java.sql.SQLException: Cannot create
-
java.sql.SQLException: Cannot create xxx 解决办法
-
java.lang.RuntimeException: Cannot create a secure XMLInputFactory
-
java.sql.SQLException: Cannot create错误
-
java.lang.RuntimeException: java.sql.SQLException: Cannot create cn.gqp.domain.Account: cn.gqp.domai