java.sql.SQLException: Cannot create com.orzxlee.d_generic.Student 异常
程序员文章站
2022-06-15 09:15:45
...
报这个异常原因是没有给 Student 类提供无参的构造器,事实上要提供无参和有参的两个构造器。
错误信息:
java.sql.SQLException: Cannot create com.orzxlee.d_generic.Student: com.orzxlee.d_generic.Student Query: select * from student Parameters: []
at org.apache.commons.dbutils.QueryRunner.rethrow(QueryRunner.java:540)
at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:397)
at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:486)
at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:505)
at com.orzxlee.d_generic.BaseDao.findAll(BaseDao.java:63)
at com.orzxlee.d_generic.TestDao.testStu(TestDao.java:12)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
上一篇: JavaBean解析
下一篇: java小特性
推荐阅读
-
java查询mysql时报“java.sql.SQLException:Cannot create ..(类名)”原因
-
使用QueryRuner出现java.sql.SQLException: Cannot create com.pojo.User:异常
-
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.sql.SQLException: Cannot create错误
-
java.lang.RuntimeException: java.sql.SQLException: Cannot create cn.gqp.domain.Account: cn.gqp.domai