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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Delphi常見的執行期Access Violation錯誤分析
- JDBC 連oracle 時出現錯誤,,求助???JDBCOracle
- ORA-7445(ACCESS_VIOLATION)(unable_to_trans_pc)(UNABLE_TO_WRITE)錯誤
- JAVA 錯誤Java
- Jdbc連線Oracle常見錯誤彙總JDBCOracle
- JDBC執行出現ORA-17410錯誤JDBC
- TNS-12560: TNS:protocol adapter error 錯誤解決ProtocolAPTError
- 檢查DISPLAY設定時Xlib出現No protocol specified錯誤Protocol
- ORA-600 [12333] "Fatal Two-Task Protocol Violation" [ID 35928.1]Protocol
- jdbc.properties報錯:java.lang.NullPointerExceptionJDBCJavaNullException
- VMware Workstation 不可恢復錯誤:(vmui) Exception 0xc0000005(access violation) has occurred.UIException
- Windows環境下的ORA-7445(ACCESS_VIOLATION)和ORA-4030錯誤Windows
- 記錄錯誤: *Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column ‘spec_templaMySqlJDBCExceptionError
- Java web錯誤總結~JavaWeb
- java通過jdbc連線oracle報錯No suitable driverJavaJDBCOracleUI
- java.exe出錯錯誤分析 (轉)Java
- Java 之 JDBCJavaJDBC
- Java之JDBCJavaJDBC
- java-jdbcJavaJDBC
- Java之JDBC①JavaJDBC
- Laravel5.4 資料庫遷移錯誤 SQLSTATE [42000] Syntax error or access violation 1071Laravel資料庫SQLError
- win10藍色畫面錯誤程式碼DPC WATCHDOG VIOLATION什麼原因怎麼解決Win10
- Java java.lang.ExceptionInInitializerError 錯誤解決方案JavaExceptionError
- 關於錯誤程式碼107(err_ssl_protocol_error)SSL 協議出錯的解決方案ProtocolError協議
- Java初學者容易犯哪些錯誤?Java
- [java基礎]之基本錯誤分析Java
- jdbc版本過低或oracle_home配置錯誤,導致ORA-28040JDBCOracle
- Java 之 JDBC(二)JavaJDBC
- 【Java】JDBC詳解JavaJDBC
- 執行dbca時報錯:Xlib:No protocol specifiedProtocol
- eclipse中:The type java.lang.object cannot be resolved錯誤(jdk配置錯誤)EclipseJavaObjectJDK
- [wm-cjdbc33-0069][Oracle JDBC Driver]Internal error: Net8 protocol errorJDBCOracleErrorProtocol
- https Java SSL Exception protocol_versionHTTPJavaExceptionProtocol
- Protocol Buffer序列化Java框架-ProtostuffProtocolJava框架
- java配置環境變數的錯誤Java變數
- Java 中最常見的 5 個錯誤Java
- 出現錯誤:java.lang.ClassCastException: java.lang.IntegerJavaASTException
- jetty 部署java web工程;報java.err.no jdk錯誤JettyJavaWebJDK