NutzCN Logo
问答 nutz报错信息能获取吗
发布于 2603天前 作者 qq_f8e6adef 1202 次浏览 复制 上一个帖子 下一个帖子
标签:

17:31:34 [DEBUG] org.nutz.dao.impl.sql.run.NutDaoExecutor - SQLException
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Out of range value for column 'ckye' at row 1
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3964) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3902) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]

执行sql时候报错,能在异常处理里面取到报错信息吗?

7 回复

肯定会抛出DaoException, catch之后getCause试试咯

我想得到“Data truncation: Out of range value for column 'ckye' at row 1”这个错误信息,怎么取?

e.getMessage 取到的是“'load data infile 'D:\apache-tomcat\plds\jndwkhckmx.txt' into table pl_jndwkhckmx fields terminated by'|' lines terminated by '”
17:45:53 [DEBUG] org.nutz.dao.impl.sql.run.NutDaoExecutor - SQLException
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Out of range value for column 'ckye' at row 1
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3964) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3902) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2526) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2673) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2503) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
at com.mysql.jdbc.StatementImpl.executeInternal(StatementImpl.java:839) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:739) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264) ~[commons-dbcp.jar:1.2.2]
at org.nutz.dao.impl.sql.run.NutDaoExecutor._runStatement(NutDaoExecutor.java:317) ~[nutz-1.b.52.jar:na]
at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:77) ~[nutz-1.b.52.jar:na]
at org.nutz.dao.impl.DaoSupport$DaoExec.invoke(DaoSupport.java:250) [nutz-1.b.52.jar:na]
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:64) [nutz-1.b.52.jar:na]
at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:205) [nutz-1.b.52.jar:na]
at org.nutz.dao.impl.DaoSupport.execute(DaoSupport.java:183) [nutz-1.b.52.jar:na]
at com.ntswy.common.base.BaseDao.executeBySql(BaseDao.java:427) [BaseDao.class:na]
at com.ntswy.pbcc.dao.DataImportDao.loadData(DataImportDao.java:75) [DataImportDao.class:na]
at com.ntswy.pbcc.action.PlDataImportAction.doPlImportData(PlDataImportAction.java:71) [PlDataImportAction.class:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_43]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_43]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_43]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_43]
at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:23) [nutz-1.b.52.jar:na]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.b.52.jar:na]
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33) [nutz-1.b.52.jar:na]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.b.52.jar:na]
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:40) [nutz-1.b.52.jar:na]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.b.52.jar:na]
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:113) [nutz-1.b.52.jar:na]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.b.52.jar:na]
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27) [nutz-1.b.52.jar:na]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.b.52.jar:na]
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15) [nutz-1.b.52.jar:na]
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:40) [nutz-1.b.52.jar:na]
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:64) [nutz-1.b.52.jar:na]
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31) [nutz-1.b.52.jar:na]
at org.nutz.mvc.NutServlet.service(NutServlet.java:65) [nutz-1.b.52.jar:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) [servlet-api.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) [catalina.jar:7.0.28]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.28]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225) [catalina.jar:7.0.28]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) [catalina.jar:7.0.28]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) [catalina.jar:7.0.28]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) [catalina.jar:7.0.28]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) [catalina.jar:7.0.28]
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) [catalina.jar:7.0.28]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) [catalina.jar:7.0.28]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) [catalina.jar:7.0.28]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001) [tomcat-coyote.jar:7.0.28]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579) [tomcat-coyote.jar:7.0.28]
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1770) [tomcat-coyote.jar:7.0.28]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [na:1.6.0_43]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [na:1.6.0_43]
at java.lang.Thread.run(Thread.java:662) [na:1.6.0_43]
17:45:53 [DEBUG] org.nutz.dao.impl.sql.run.NutDaoExecutor - SQL NextException
org.nutz.dao.DaoException: org.nutz.dao.DaoException: !Nutz SQL Error: 'load data infile 'D:\apache-tomcat\plds\jndwkhckmx.txt' into table pl_jndwkhckmx fields terminated by'|' lines terminated by '
''
PreparedStatement:
'load data infile 'D:\apache-tomcat\plds\jndwkhckmx.txt' into table pl_jndwkhckmx fields terminated by'|' lines terminated by '
''
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:76)
at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:205)
at org.nutz.dao.impl.DaoSupport.execute(DaoSupport.java:183)
at com.ntswy.common.base.BaseDao.executeBySql(BaseDao.java:427)
at com.ntswy.pbcc.dao.DataImportDao.loadData(DataImportDao.java:75)
at com.ntswy.pbcc.action.PlDataImportAction.doPlImportData(PlDataImportAction.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:23)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:40)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:113)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:40)
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:64)
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
at org.nutz.mvc.NutServlet.service(NutServlet.java:65)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1770)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.nutz.dao.DaoException: !Nutz SQL Error: 'load data infile 'D:\apache-tomcat\plds\jndwkhckmx.txt' into table pl_jndwkhckmx fields terminated by'|' lines terminated by '
''
PreparedStatement:
'load data infile 'D:\apache-tomcat\plds\jndwkhckmx.txt' into table pl_jndwkhckmx fields terminated by'|' lines terminated by '
''
at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:95)
at org.nutz.dao.impl.DaoSupport$DaoExec.invoke(DaoSupport.java:250)
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:64)
... 41 more
Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Out of range value for column 'ckye' at row 1
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3964)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3902)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2526)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2673)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2503)
at com.mysql.jdbc.StatementImpl.executeInternal(StatementImpl.java:839)
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:739)
at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
at org.nutz.dao.impl.sql.run.NutDaoExecutor._runStatement(NutDaoExecutor.java:317)
at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:77)
... 43 more

先getCause啊

哦,那就没办法了

添加回复
请先登陆
回到顶部