我有下面的代码。相当标准的东西。但是,我在 if(!stmt.isClose()) 行上遇到非法访问异常......该错误表明这是因为该语句已关闭。这不是该方法调用的重点吗?有人对此有什么想法吗?
Connection conn = dataSource.getConnection();
conn.setAutoCommit(false);
Statement stmt = conn.createStatement();
try {
stmt.executeUpdate(updateQuery1);
stmt.executeUpdate(updateQuery2);
stmt.executeUpdate(updateQuery3);
conn.commit();
try {
if (!stmt.isClosed()) {
stmt.close();
}
if (!conn.isClosed()) {
conn.close();
}
} catch (Throwable ignored) {
} catch(Throwable ignored) {
}
499285 java.lang.IllegalAccessError: org.apache.tomcat.dbcp.dbcp.DelegatingStatement.isClosed()Z
499286 at com.millennialmedia.enterprise.services.impl.CampaignUtilServiceImpl.resetExceptionCampaign(CampaignUtilServiceImpl.java:80)
499287 at com.millennialmedia.rest.services.CampaignUtilRESTService$1.process(CampaignUtilRESTService.java:55)
499288 at com.millennialmedia.rest.services.CampaignUtilRESTService$1.process(CampaignUtilRESTService.java:49)
499289 at com.millennialmedia.services.util.Processor.doProcess(Processor.java:98)
499290 at com.millennialmedia.rest.services.CampaignUtilRESTService.resetExceptionCampaign(CampaignUtilRESTService.java:49)
499291 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
499292 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
499293 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
499294 at java.lang.reflect.Method.invoke(Method.java:597)
499295 at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
499296 at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchPro
499297 at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
499298 at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
499299 at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
499300 at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
499301 at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
499302 at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
499303 at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
499304 at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
499305 at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
499306 at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
499307 at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
499308 at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
499309 at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)
499310 at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
499311 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
499312 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
499313 at com.millennialmedia.instrumentation.MethodInvocationFilter._doFilter(MethodInvocationFilter.java:20)
499314 at com.millennialmedia.instrumentation.MethodInvocationFilter.doFilter(MethodInvocationFilter.java:31)
499315 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
499316 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
499317 at com.millennialmedia.session.BaseAuthenticatedUserFilter.doFilter(BaseAuthenticatedUserFilter.java:249)
499318 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
499319 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
499320 at com.millennialmedia.session.HibernateSessionRequestFilter.doFilter(HibernateSessionRequestFilter.java:57)
499321 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
499322 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
499323 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
499324 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
499325 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
499326 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
499327 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
499328 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
499329 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
499330 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
499331 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)