java.lang.ClassCastException with JAXWS version 2.2.11.
search cancel

java.lang.ClassCastException with JAXWS version 2.2.11.

book

Article ID: 127036

calendar_today

Updated On: 10-12-2023

Products

CA Application Performance Management Agent (APM / Wily / Introscope) INTROSCOPE

Issue/Introduction

WILY Agent in tomcat applications giving below exceptions. These issues are seen for the apps which are using JAXWS version 2.2.11.
Once the WILY Agent is disabled on the Tomcat Servers, we are not seeing this issue and the apps are working fine.

Stacktrace:] with root cause java.lang.ClassCastException: com.sun.xml.ws.transport.Headers cannot be cast to com.sun.xml.ws.transport.Headers at com.sun.xml.ws.client.RequestContext.mergeRequestHeaders(RequestContext.java:337) at com.sun.xml.ws.client.RequestContext.fill(RequestContext.java:301) at com.sun.xml.ws.client.Stub.configureRequestPacket(Stub.java:492) at com.sun.xml.ws.client.Stub.process(Stub.java:450) at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:191) at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108) at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:92) at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:161)

Environment

CA APM 10.3 - All agents, Collectors and MOM 

Cause

Newer versions of JAX-WS (2.2.6 or higher) expect usage of com.sun.xml.ws.transport.Headers instead of java.util.HashMap

Resolution

Configure SPM Compatibility With JAX-WS 2.2.6 or Higher



Newer versions of JAX-WS (2.2.6 or higher) expect usage of com.sun.xml.ws.transport.Headers instead of java.util.HashMap. To avoid a ClassCastException when your application makes a webservice call, uncomment the following configuration property in the IntroscopeAgent.profile file:




com.wily.introscope.agent.soa.JAXWSHeadersClassName=com.sun.xml.ws.transport.Headers


This change does not have any impact on cross-process or cross-JVM transaction tracing. It will also not break the old functionality. If the application has two JAX-WS implementations for different features of the application, both will work when this property is enabled.

Additional Information

https://techdocs.broadcom.com/us/en/ca-enterprise-software/it-operations-management/dx-apm-agents/SaaS/java-agent/java-agent-extensions/service-oriented-architecture-platform/soa-specific-agent-configuration-properties.html