java.sql.SQLException: Protocol violation caught while accessing a page and Oracle DB is used
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
Users are not able to access particular pages in Confluence.
The following appears in the atlassian-confluence.log
2015-09-02 08:38:58,612 ERROR [http-bio-8090-exec-24258] [sf.hibernate.collection.PersistentCollection] initialize Failed to lazily initialize a collection
-- url: /display/webservices/CMS+Essentials | page: 52895049 | userName: mh993 | referer: https://<URL>/display/webservices/Home | action: viewpage
net.sf.hibernate.exception.GenericJDBCException: could not initialize collection: [com.atlassian.confluence.core.ContentEntityObject.bodyContents#52895049]
at net.sf.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:90)
at net.sf.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:79)
...
Caused by: java.sql.SQLException: Protocol violation: [ 14, 34, ]
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:669)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:249)
at oracle.jdbc.driver.T4C8TTIClob.read(T4C8TTIClob.java:245)
at oracle.jdbc.driver.T4CConnection.getChars(T4CConnection.java:3901)
at oracle.sql.CLOB.getChars(CLOB.java:517)
at oracle.sql.CLOB.getSubString(CLOB.java:354)
at org.springframework.jdbc.support.lob.OracleLobHandler.getClobAsString(OracleLobHandler.java:187)
...
2015-09-02 08:38:58,628 ERROR [http-bio-8090-exec-24258] [sf.hibernate.transaction.JDBCTransaction] rollback Rollback failed
-- url: /display/webservices/CMS+Essentials | userName: mh993 | referer: https://<URL>/display/webservices/Home
java.sql.SQLException: Protocol violation: [ 0, ]
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:669)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:249)
at oracle.jdbc.driver.T4C7Ocommoncall.doOROLLBACK(T4C7Ocommoncall.java:66)
Diagnosis
Environment
As
SQLException: Protocol violation
itself is normally caused by the Oracle driver. Therefore, first please ensure that you've used the correct Database JDBC Driver in your Confluence instance.Your Confluence instance is configured to use Oracle ojdbc7.jar version 12.1.0.1 to connect to your Oracle 12c Database.
Cause
Should the issue still persist after you use the correct JDBC Driver and indeed you're using Oracle ojdbc7.jar version 12.1.0.1 for your Oracle 12c Database, you are then hitting a known bug in Oracle ojdbc7.jar version 12.1.0.1 driver itself as discussed in this StackOverflow post.
Resolution
- Stop Confluence
- Download ojdbc7.jar version 12.1.0.2.
- Update your JDBC driver by copying the driver JAR file to the
<Confluence-Installation>
folder in your Confluence installation./confluence
/WEB-INF/lib - Restart Confluence.