java.lang.ClassCastException with JAXWS version 2.2.11.

book

Article ID: 127036

calendar_today

Updated On:

Products

APP PERF MANAGEMENT CA Application Performance Management Agent (APM / Wily / Introscope) CUSTOMER EXPERIENCE MANAGER 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)

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

Environment

CA APM 10.3 - All agents, Collectors and MOMĀ 

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://docops.ca.com/ca-apm/10-3/en/implementing-agents/java-agent/java-agent-extensions/service-oriented-architecture-platform/configure-soa-specific-properties