Fixes are available
8.5.5.2: WebSphere Application Server V8.5.5 Fix Pack 2
8.5.5.3: WebSphere Application Server V8.5.5 Fix Pack 3
8.5.5.4: WebSphere Application Server V8.5.5 Fix Pack 4
8.5.5.5: WebSphere Application Server V8.5.5 Fix Pack 5
8.5.5.6: WebSphere Application Server V8.5.5 Fix Pack 6
8.5.5.7: WebSphere Application Server V8.5.5 Fix Pack 7
8.5.5.8: WebSphere Application Server V8.5.5 Fix Pack 8
8.5.5.9: WebSphere Application Server V8.5.5 Fix Pack 9
8.5.5.10: WebSphere Application Server V8.5.5 Fix Pack 10
8.5.5.11: WebSphere Application Server V8.5.5 Fix Pack 11
8.5.5.12: WebSphere Application Server V8.5.5 Fix Pack 12
8.5.5.13: WebSphere Application Server V8.5.5 Fix Pack 13
8.5.5.14: WebSphere Application Server V8.5.5 Fix Pack 14
8.5.5.15: WebSphere Application Server V8.5.5 Fix Pack 15
8.5.5.14: WebSphere Application Server V8.5.5 Fix Pack 14
8.5.5.17: WebSphere Application Server V8.5.5 Fix Pack 17
8.5.5.20: WebSphere Application Server V8.5.5.20
8.5.5.18: WebSphere Application Server V8.5.5 Fix Pack 18
8.5.5.19: WebSphere Application Server V8.5.5 Fix Pack 19
8.5.5.16: WebSphere Application Server V8.5.5 Fix Pack 16
8.5.5.21: WebSphere Application Server V8.5.5.21
APAR status
Closed as program error.
Error description
Invoke method of SecurityContext in a EJB-in-WAR JAX-RS application may cause a ClassCastException
Local fix
Problem summary
**************************************************************** * USERS AFFECTED: All users of IBM WebSphere Application * * Server Liberty Profile who use EJB in WAR * **************************************************************** * PROBLEM DESCRIPTION: Invoking methods of * * javax.ws.rs.core.SecurityContext in a * * EJB-in-WAR JAX-RS application will * * cause a ClassCastException * **************************************************************** * RECOMMENDATION: * **************************************************************** When using injection in an EJB-in-WAR JAX-RS application with annotation below: @javax.ws.rs.core.Context ‚   javax.ws.rs.core.SecurityContext context; ‚   And invoke methods of javax.ws.rs.core.SecurityContext, an exception will be thrown: Caused by: java.lang.ClassCastException: com.ibm.ejs.csi.EJBModuleMetaDataImpl incompatible with com.ibm.wsspi.webcontainer.metadata.WebModuleMetaData ‚   The root cause of this problem is: once the code gets the EJB instances from EJB container, the context metadata is updated, while the runtime codes may still use HttpServletRequest to read the corresponding information.
Problem conclusion
To fix the problem, the solution is to save the web module metadata, and create a new class JAXRSHttpServletRequestAdapter that implements HttpServletRequest and override the methods. In each method, we recover web module metadata before invoking the target method in HttpServletRequest: public class JAXRSHttpServletRequestAdapter implements HttpServletRequest { ...... @Override public Object getAttribute(String arg0) { try { collaborator.preInvoke(componentMetaData); return request.getAttribute(arg0); } finally { collaborator.postInvoke(); } } ...... } The fix for this APAR is currently targeted for inclusion in fix pack 8.5.5.2. Please refer to the Recommended Updates page for delivery information: http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
Temporary fix
Comments
APAR Information
APAR number
PI05977
Reported component name
LIBERTY PROFILE
Reported component ID
5724J0814
Reported release
850
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2013-11-12
Closed date
2013-12-04
Last modified date
2013-12-04
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
LIBERTY PROFILE
Fixed component ID
5724J0814
Applicable component levels
R850 PSY
UP
Document Information
Modified date:
28 April 2022