[WLS 12.1.3]-java.lang.ClassCastException: xyz.ebeans.example_abcde_EOImpl cannot be cast to javax.ejb.Handle (Doc ID 2008791.1)

Last updated on JUNE 09, 2016

Applies to:

Oracle WebLogic Server - Version 12.1.2.0.0 to 12.1.3.0.0 [Release 12c]
Information in this document applies to any platform.

Goal

When upgraded to WLS 12.1.3 from WLS 10.3.3 noticing below error while retrieving the EJBObject from handle. This is EJB2.0 stateful session bean.This works perfectly fine on WLS 10.3.3.

The use case involves storing of the handle to the EJB object in HTTP session, and the ClassCastException happens when the EJBObject retrieved from the HTTP session is cast back to EJB Handle instead.

Solution

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms