My Oracle Support Banner

"java.lang.ClassCastException: java.lang.Boolean cannot be cast to oracle.ucp.jdbc.oracle.OracleConnectionAffinityContext" Error When Calling Getconnectionaffinitycontext() Method in Class SessionAffinityCallback or XAAffinityCallback in a Grid Link DS (Doc ID 2284500.1)

Last updated on OCTOBER 17, 2018

Applies to:

Oracle WebLogic Server - Version 12.1.3.0.0 and later
Information in this document applies to any platform.

Symptoms

When calling getConnectionAffinityContext in class weblogic/jdbc/common/internal/SessionAffinityCallback or weblogic/jdbc/common/internal/XAAffinityCallback, the returning type for the method is not consistent.

- if there is an exception thrown in the method, it returns a Boolean object instead of the expected null object

- otherwise, it returns oracle.ucp.jdbc.oracle.OracleConnectionAffinityContext which is the expected value

 

Eventually, when an exception is thrown, it causes the additional exception below as that is not expected by the application. The excepted return type is either a null object or oracle.ucp.jdbc.oracle.OracleConnectionAffinityContext object.

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.