[jboss-jira] [JBoss JIRA] (DROOLS-437) Kie :: Camel - ClassCast exception in PreCxfTransportSoapProcessor class
Jurij Kovacic (JIRA)
issues at jboss.org
Tue Feb 18 11:35:47 EST 2014
Jurij Kovacic created DROOLS-437:
------------------------------------
Summary: 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)
running on:
Distributor ID: Ubuntu
Description: Ubuntu 12.04.4 LTS
Release: 12.04
Codename: precise
Reporter: Jurij Kovacic
Assignee: Mark Proctor
After sending a test SOAP request to (compiled) "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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list