-
Bug
-
Resolution: Done
-
Normal
-
2.13.7.GA
-
False
-
-
False
-
-
-
-
Moderate
-
0
We have a simple camel-cxf route:
from("cxf:bean:cxfServerBean") .setHeader(Exchange.HTTP_METHOD, constant(HttpPost.METHOD_NAME)) .setHeader(Exchange.CONTENT_TYPE, constant("application/xml")) .removeHeader(Exchange.HTTP_PATH) .to("http://localhost:8081/hello?bridgeEndpoint=true");
However, it throws a ClassCastException:
java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class java.util.Map (java.util.ArrayList and java.util.Map are in module java.base of loader 'bootstrap') at org.apache.camel.component.cxf.jaxws.DefaultCxfBinding.extractInvocationContextFromCamel(DefaultCxfBinding.java:598) at org.apache.camel.component.cxf.jaxws.DefaultCxfBinding.populateCxfHeaderFromCamelExchangeBeforeCheckError(DefaultCxfBinding.java:396) at org.apache.camel.component.cxf.jaxws.CxfConsumer$CxfConsumerInvoker.setResponseBack(CxfConsumer.java:321) at org.apache.camel.component.cxf.jaxws.CxfConsumer$CxfConsumerInvoker.syncInvoke(CxfConsumer.java:248) at org.apache.camel.component.cxf.jaxws.CxfConsumer$CxfConsumerInvoker.invoke(CxfConsumer.java:164) ......
The "ResponseContext" header was populated in the camel exchange IN message after invoking against the other camel endpoint "http://localhost:8081/hello?bridgeEndpoint=true". The method "extractInvocationContextFromCamel" of the DefaultCxfBinding class was also called. Because the "ResponseContext" header was initialised as an ArrayList type, therefore, the exception was thrown at the line #598 in the DefaultCxfBinding.java class:
https://github.com/apache/camel/blob/camel-3.18.x/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java#L598
- links to
-
RHEA-2023:123625 Red Hat Build of Apache Camel for Quarkus 3.2.0 release (RHBQ 3.2.6.SP1)
- mentioned on