[jboss-jira] [JBoss JIRA] (DROOLS-437) Kie :: Camel - ClassCast exception in PreCxfTransportSoapProcessor class
Edson Tirelli (JIRA)
issues at jboss.org
Thu May 8 16:25:57 EDT 2014
[ https://issues.jboss.org/browse/DROOLS-437?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Edson Tirelli resolved DROOLS-437.
----------------------------------
Fix Version/s: 6.1.0.Beta4
Resolution: Done
Thanks for reporting and providing a suggested fix.
> Kie :: Camel - ClassCast exception in PreCxfTransportSoapProcessor class
> ------------------------------------------------------------------------
>
> Key: DROOLS-437
> URL: https://issues.jboss.org/browse/DROOLS-437
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 6.0.1.Final
> Environment: java version "1.7.0_51"
> Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
> Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
> on application server:
> JBoss AS 7.1.1.Final "Brontes"
> running on:
> Distributor ID: Ubuntu
> Description: Ubuntu 12.04.4 LTS
> Release: 12.04
> Codename: precise
> Reporter: Jurij Kovacic
> Assignee: Edson Tirelli
> Labels: apache, camel
> Fix For: 6.1.0.Beta4
>
>
> After sending a test SOAP request to (compiled) "Drools Camel server example" from "droolsjbpm-integration-master/drools-camel-server-example", running on JBoss7 application server, the following exception occurs:
> ...
> java.lang.ClassCastException: org.apache.cxf.binding.soap.SoapMessage cannot be cast to java.lang.String
> at org.kie.jax.soap.PreCxfTransportSoapProcessor.process(PreCxfTransportSoapProcessor.java:36) [kie-camel-6.0.1.Final.jar:6.0.1.Final]
> ...
> I used the following patch (hack), to make the example work:
> diff --git a/kie-camel/src/main/java/org/kie/jax/soap/PreCxfTransportSoapProcessor.java b/kie-camel/src/main/java/or
> index c646f97..39e2afc 100644
> --- a/kie-camel/src/main/java/org/kie/jax/soap/PreCxfTransportSoapProcessor.java
> +++ b/kie-camel/src/main/java/org/kie/jax/soap/PreCxfTransportSoapProcessor.java
> @@ -33,8 +33,10 @@ public class PreCxfTransportSoapProcessor
> Map<String, Object> headers = exchange.getIn().getHeaders();
> MimeHeaders mimeHeaders = new MimeHeaders();
> for ( String header : headers.keySet() ) {
> - mimeHeaders.addHeader( header,
> - (String) headers.get( header ) );
> + // hack for avoiding uncaught exceptions when SOAP message is typecast to string
> + try { mimeHeaders.addHeader( header, (String) headers.get( header ) );}
> + catch(ClassCastException e){}
> +
> }
> SOAPMessage soapMessage = MessageFactory.newInstance().createMessage( mimeHeaders,
> is );
> It seems to me that the call to:
> ...
> exchange.getIn().getHeaders()
> ...
>
> apart from valid MIME headers, such as host, content-type etc also (wrongly?) returns the entire SOAP request object, which then cannot be typecast to string.
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
More information about the jboss-jira
mailing list