My Oracle Support Banner

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

Last updated on SEPTEMBER 29, 2023

Applies to:

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


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 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 object.





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

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