NutzCN Logo
问答 异常捕捉不到的问题
发布于 3205天前 作者 efraiser 2260 次浏览 复制 上一个帖子 下一个帖子
标签:

系统报的异常代码
13:50:00 [DEBUG] org.nutz.dao.impl.sql.run.NutDaoExecutor - SQLException
com.ibm.db2.jcc.am.io: DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=KJRQ, DRIVER=3.57.82
我捕捉异常的代码
try {
Dao eastDao = EastConUtil.getNewConnect(brNo);// 获取数据库连接
String tableSchema = sysEastUrlDao.fetch(brNo).getTableSchema();
if (eastDao.count(tableSchema + ".T_GX_YGB", Cnd.where("cjrq", "=", reportDate)) > 0) {
** toStartCheck(brNo, reportDate, tableSchema, eastDao);**
} else {
EastConUtil.dsClose();//关闭数据库连接
return super.requestResult(false, brNo + "机构 " + reportDate.substring(0, 6) + "月EAST报表还没有生成,请先生成报表!");
}
}** catch (Exception e) {
EastConUtil.dsClose();
return super.requestResult(false, e.getMessage());**
}
抛出异常的方法
public void toStartCheck(String brNo, String reportDate, String tableSchema, Dao eastDao) throws NullPointerException,SQLException {
List lists = checkFormulaDao.dao().query(CheckFormula.class, null);

    这个异常出来了之后,我的这次的操作还在往下面运行并没有断了,我自己想让函数执行结束并返回的
3 回复

把异常信息贴一下, 然后逐层检查,看看是不是哪个方法把异常吃掉了

16:27:14 [DEBUG] org.nutz.dao.impl.sql.run.NutDaoExecutor - SQLException
com.ibm.db2.jcc.am.io: DB2 SQL Error: SQLCODE=-10, SQLSTATE=42603, SQLERRMC='), DRIVER=3.57.82
at com.ibm.db2.jcc.am.bd.a(bd.java:676) ~[db2jcc.jar:na]
at com.ibm.db2.jcc.am.bd.a(bd.java:60) ~[db2jcc.jar:na]
at com.ibm.db2.jcc.am.bd.a(bd.java:127) ~[db2jcc.jar:na]
at com.ibm.db2.jcc.am.km.c(km.java:2506) ~[db2jcc.jar:na]
at com.ibm.db2.jcc.am.km.d(km.java:2483) ~[db2jcc.jar:na]
at com.ibm.db2.jcc.am.km.a(km.java:1963) ~[db2jcc.jar:na]
at com.ibm.db2.jcc.t4.db.g(db.java:139) ~[db2jcc.jar:na]
at com.ibm.db2.jcc.t4.db.a(db.java:39) ~[db2jcc.jar:na]
at com.ibm.db2.jcc.t4.t.a(t.java:32) ~[db2jcc.jar:na]
at com.ibm.db2.jcc.t4.sb.h(sb.java:135) ~[db2jcc.jar:na]
at com.ibm.db2.jcc.am.km.eb(km.java:1934) ~[db2jcc.jar:na]
at com.ibm.db2.jcc.am.lm.ic(lm.java:2798) ~[db2jcc.jar:na]
at com.ibm.db2.jcc.am.lm.b(lm.java:3517) ~[db2jcc.jar:na]
at com.ibm.db2.jcc.am.lm.Yb(lm.java:2130) ~[db2jcc.jar:na]
at com.ibm.db2.jcc.am.lm.execute(lm.java:2114) ~[db2jcc.jar:na]
at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:169) ~[commons-dbcp.jar:1.2.2]
at org.nutz.dao.impl.sql.run.NutDaoExecutor._runPreparedStatement(NutDaoExecutor.java:266) ~[nutz-1.b.53.jar:na]
at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:81) ~[nutz-1.b.53.jar:na]
at org.nutz.dao.impl.DaoSupport$DaoExec.invoke(DaoSupport.java:264) [nutz-1.b.53.jar:na]
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:64) [nutz-1.b.53.jar:na]
at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:219) [nutz-1.b.53.jar:na]
at org.nutz.dao.impl.DaoSupport.execute(DaoSupport.java:197) [nutz-1.b.53.jar:na]
at org.nutz.dao.impl.NutDao.execute(NutDao.java:967) [nutz-1.b.53.jar:na]
at com.efraiser.common.util.EastConUtil.setResultToDB(EastConUtil.java:149) [EastConUtil.class:na]
at com.efraiser.ews.action.CheckNotNullAction.toStartCheck(CheckNotNullAction.java:148) [CheckNotNullAction.class:na]
at com.efraiser.ews.action.CheckNotNullAction.startCheck(CheckNotNullAction.java:98) [CheckNotNullAction.class:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_45]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_45]
at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:25) [nutz-1.b.53.jar:na]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.b.53.jar:na]
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33) [nutz-1.b.53.jar:na]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.b.53.jar:na]
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:40) [nutz-1.b.53.jar:na]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.b.53.jar:na]
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:113) [nutz-1.b.53.jar:na]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.b.53.jar:na]
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27) [nutz-1.b.53.jar:na]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.b.53.jar:na]
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15) [nutz-1.b.53.jar:na]
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:40) [nutz-1.b.53.jar:na]
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67) [nutz-1.b.53.jar:na]
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31) [nutz-1.b.53.jar:na]
at org.nutz.mvc.NutServlet.service(NutServlet.java:66) [nutz-1.b.53.jar:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) [servlet-api.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) [catalina.jar:7.0.59]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.59]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat7-websocket.jar:7.0.59]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.59]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.59]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) [catalina.jar:7.0.59]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) [catalina.jar:7.0.59]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504) [catalina.jar:7.0.59]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) [catalina.jar:7.0.59]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) [catalina.jar:7.0.59]
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) [catalina.jar:7.0.59]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) [catalina.jar:7.0.59]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421) [catalina.jar:7.0.59]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074) [tomcat-coyote.jar:7.0.59]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) [tomcat-coyote.jar:7.0.59]
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) [tomcat-coyote.jar:7.0.59]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_45]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-coyote.jar:7.0.59]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]
报错信息是这样的,看不出来被哪个吃了

你的意思是"startCheck"没有走到catch里面?

那得debug一下setResultToDB和toStartCheck方法了

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