You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ge...@apache.org on 2008/10/14 21:56:47 UTC

svn commit: r704649 - /servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiBinding.java

Author: gertv
Date: Tue Oct 14 12:56:47 2008
New Revision: 704649

URL: http://svn.apache.org/viewvc?rev=704649&view=rev
Log:
SM-1629: Handle NoTypeConversionAvailableException that is thrown in Camel 1.5

Modified:
    servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiBinding.java

Modified: servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiBinding.java
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiBinding.java?rev=704649&r1=704648&r2=704649&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiBinding.java (original)
+++ servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiBinding.java Tue Oct 14 12:56:47 2008
@@ -34,6 +34,7 @@
 import org.apache.camel.Exchange;
 import org.apache.camel.ExchangePattern;
 import org.apache.camel.Message;
+import org.apache.camel.NoTypeConversionAvailableException;
 import org.apache.camel.util.ExchangeHelper;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -58,7 +59,12 @@
     }
 
     public Source convertBodyToJbi(Exchange exchange, Object body) {
-        return ExchangeHelper.convertToType(exchange, Source.class, body);
+        try {
+           return ExchangeHelper.convertToType(exchange, Source.class, body);
+        } catch (NoTypeConversionAvailableException e) {
+           LOG.warn("Unable to convert " + body.getClass() + " to an XML Source, value will be null");
+           return null;
+        }
     }
 
     public MessageExchange makeJbiMessageExchange(Exchange camelExchange,