使用Oracle,但用不了多久就提示“违反协议”,问问大家有解决方法吗?

com.jfinal.plugin.activerecord.ActiveRecordException: java.sql.SQLException: 违反协议: [0]
	at com.jfinal.plugin.activerecord.DbPro.find(DbPro.java:345)
	at com.jfinal.plugin.activerecord.Db.find(Db.java:271)
	at com.zshsoft.yshis.service.prescription.PrescriptionService.groupByAKA204(PrescriptionService.java:776)
	at com.zshsoft.yshis.controller.prescription.PrescriptionController.groupByAKA204(PrescriptionController.java:372)
	at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:73)
	at com.zshsoft.yshis.web.intercept.LoginInterceptor.intercept(LoginInterceptor.java:57)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
	at com.zshsoft.yshis.web.intercept.ThreadLocalIntercept.intercept(ThreadLocalIntercept.java:29)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
	at com.jfinal.ext.interceptor.SessionInViewInterceptor.intercept(SessionInViewInterceptor.java:44)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
	at com.jfinal.core.ActionHandler.handle(ActionHandler.java:86)
	at com.jfinal.ext.handler.UrlSkipHandler.handle(UrlSkipHandler.java:46)
	at com.zshsoft.yshis.web.handler.BasePathHandler.handle(BasePathHandler.java:35)
	at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:73)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.sql.SQLException: 违反协议: [0]
	at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:464)
	at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
	at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
	at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
	at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:884)
	at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1167)
	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1289)
	at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3584)
	at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3628)
	at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1493)
	at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeQuery(FilterChainImpl.java:2714)
	at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_executeQuery(FilterEventAdapter.java:465)
	at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeQuery(FilterChainImpl.java:2711)
	at com.alibaba.druid.wall.WallFilter.preparedStatement_executeQuery(WallFilter.java:604)
	at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeQuery(FilterChainImpl.java:2711)
	at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.executeQuery(PreparedStatementProxyImpl.java:132)
	at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeQuery(DruidPooledPreparedStatement.java:227)
	at com.jfinal.plugin.activerecord.DbPro.find(DbPro.java:330)
	at com.jfinal.plugin.activerecord.DbPro.find(DbPro.java:343)
	... 34 more

我的项目是使用JF3.4+Oracle11G。在查询时经常看到这个错误,请问大家有没有遇到过?


度娘上有这样说

@Resource(name = "druidDataSource")
private DruidDataSource druidDataSource;
public void clearDruidStatementCache() {
Log.info("DruidDataSource", "清除Druid的Statement Cache Start......");
if (druidDataSource != null) {
try {
druidDataSource.clearStatementCache();
} catch (SQLException e) {
Log.error("DruidDataSource", "清除Druid的Statement Cache Error", e);
}
}
Log.info("DruidDataSource", "清除Druid的Statement Cache End......");
}

@JFinal。这个在JF中如何做?

评论区

JFinal

2018-07-25 20:31

这个从来没碰到过,可能是 sql 有错误

热门反馈

扫码入社