java jdbc Protocol violation錯誤
; uncategorized SQLException for SQL []; SQL state [99999]; error code [17401]; Protocol violation: [48]; nested exception is java.sql.SQLException: Protocol violation: [48]
網上查到的資料是這樣的,做個筆記:
SQLException: Protocol violation. Oracle JDBC Driver issue
java.sql.SQLException: Protocol violation caught while accessing a page and Oracle DB is used
開啟上面連結,看到意思是
Symptom
This exception was happening occasionally. The stack trace had different sql in it which was very confusing. Running the sql with sql plus worked fine.
Root Cause
The exception was thrown when oracle driver was trying to export a CLOB data. This was happening with only few records, not all of them. The data as such was a file. Visually we could not make out what was wrong with that data.
Why we were seeing errors in oracle logs ?
So if this was a driver defect, why did we see the error in oracle trace ? Logically the driver errors should be only confined to application logs. The reasons was that when protocol violation happened, the connection got corrupted. This connection was returned to the connection pool. Any user or job when will use that connection would not work and would experience error. That is why it will happen at random places, with random users
Solution
A short term fix was to change this property in connection pool. We are using DBCP connection pool.
Changed from ds.setTestOnBorrow(false); to ds.setTestOnBorrow(true);
Now when the pool returns a corrupted connection to the pool, before app borrows this connection , it would test for validity. If connection is unusable, pool would discard and then app gets a new/valid connection.
If you enable connection pool logs, you should see the exception which normally is swallowed.
Driver Upgrade
Upgrade to OJDBC 12.1.0.2 from OJDBC 12.1.0.1 solved the problem, even for the problematic rows.
Some other links for reference
%3A+Protocol+violation+caught+while+accessing+a+page+and+Oracle+DB+is+used
總結:主要意思是和ojdbc驅動有關係,對應的jdk,對應的資料庫版本使用對應的ojdbc。 然後去官網下載對應的jdbc版本,連結地址是:oracle jdbc驅動下載
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30393770/viewspace-2128582/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Laravel5.4 資料庫遷移錯誤 SQLSTATE [42000] Syntax error or access violation 1071Laravel資料庫SQLError
- jdbc.properties報錯:java.lang.NullPointerExceptionJDBCJavaNullException
- 記錄錯誤: *Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column ‘spec_templaMySqlJDBCExceptionError
- VMware Workstation 不可恢復錯誤:(vmui) Exception 0xc0000005(access violation) has occurred.UIException
- 關於錯誤程式碼107(err_ssl_protocol_error)SSL 協議出錯的解決方案ProtocolError協議
- win10藍色畫面錯誤程式碼DPC WATCHDOG VIOLATION什麼原因怎麼解決Win10
- Java 之 JDBCJavaJDBC
- Java之JDBCJavaJDBC
- eclipse中:The type java.lang.object cannot be resolved錯誤(jdk配置錯誤)EclipseJavaObjectJDK
- 解決java.lang.NoSuchMethodError錯誤JavaError
- [java基礎]之基本錯誤分析Java
- Java 之 JDBC(二)JavaJDBC
- 【Java】JDBC詳解JavaJDBC
- https Java SSL Exception protocol_versionHTTPJavaExceptionProtocol
- IDEA報錯java: 編譯失敗: 內部 java 編譯器錯誤IdeaJava編譯
- java配置環境變數的錯誤Java變數
- Java初學者容易犯哪些錯誤?Java
- SAP Java Connector 錯誤 - JCO_ERROR_COMMUNICATIONJavaError
- 錯誤: 代理丟擲異常錯誤: java.rmi.server.ExportException: Port already in use: 1099;JavaServerExportException
- 執行遷移檔案報錯: Syntax error or access violation: 1166 ...Error
- 漏洞反饋,使用者授權報錯Integrity constraint violationAI
- Java JDBC連線MYsqlJavaJDBCMySql
- IDEA發生“Error:java: 錯誤: 不支援發行版本 5”錯誤的解決方案IdeaErrorJava
- 【常見錯誤】--Nltk使用錯誤
- iis7.5錯誤 配置錯誤
- Protocol Buffer序列化Java框架-ProtostuffProtocolJava框架
- Java開發熟手該當心的錯誤Java
- Java學習:JDBC簡介JavaJDBC
- win10系統提示access violation at address出錯的解決方法Win10
- nginx 錯誤除錯Nginx除錯
- Java初學者容易犯的程式碼錯誤Java
- Python 指令碼中呼叫 Java 程式時 Classpath 錯誤Python指令碼Java
- IPMI報jnlp錯誤,無法開啟java程式Java
- java.sql.SQLException:IO 錯誤:Socket read timed out !JavaSQLException
- 微信提現報錯:protocol is disabled or cipher suites are inapproprProtocolUIAPP
- PbootCMS錯誤提示:執行SQL發生錯誤!錯誤:no such column: def1bootSQL
- 前端錯誤前端
- JavaFx 錯誤Java
- ORACLE 錯誤Oracle