Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 41091 invoked from network); 5 Nov 2009 05:17:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Nov 2009 05:17:15 -0000 Received: (qmail 84222 invoked by uid 500); 5 Nov 2009 05:17:15 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 84174 invoked by uid 500); 5 Nov 2009 05:17:14 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 84161 invoked by uid 99); 5 Nov 2009 05:17:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Nov 2009 05:17:14 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of willem.jiang@gmail.com designates 209.85.210.203 as permitted sender) Received: from [209.85.210.203] (HELO mail-yx0-f203.google.com) (209.85.210.203) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Nov 2009 05:17:05 +0000 Received: by yxe41 with SMTP id 41so19821079yxe.30 for ; Wed, 04 Nov 2009 21:16:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=PSyLIEoH61qDI5lA5mDxYf5vymRhhvewgG5wzsdtEFc=; b=VLkCvxYZzbuHEKDD37bgqdMa1H6gT3vke3I37XbRfkqfLy5cBh4yS2as3DB1DfNOhT VtagyXkOpDr+6el4ysPEBYWJ446SsVRz9e1E9J8lg5uweZRXm5b9lFF4uuTRo1kuqGux EYlkKgPB4MJWw+Ypg52ndX3D7vysWiAa8wsoE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=oehMGAA/t+YrYOmWpb/k5Ze9s6zKsmIQqb5RHYrjy1ncDVvNJ7nUC/CvZg+IVfGfvB y0teOdQaNtvkYBVowiRl5hCPPIr4otzyUQvDN2rus+PTkTeb8d/DZkuhL9BNau+Sd+60 5IpNB7D4l+lDtxVVvpHSZHxcgqb2CBCm6FeQg= Received: by 10.91.72.26 with SMTP id z26mr5324726agk.17.1257398204033; Wed, 04 Nov 2009 21:16:44 -0800 (PST) Received: from ?192.168.0.158? ([125.34.0.19]) by mx.google.com with ESMTPS id 23sm820526yxe.0.2009.11.04.21.16.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 04 Nov 2009 21:16:43 -0800 (PST) Message-ID: <4AF25FAE.2060805@gmail.com> Date: Thu, 05 Nov 2009 13:16:30 +0800 From: Willem Jiang User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: dev@camel.apache.org Subject: Re: svn commit: r832981 - /camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelConduit.java References: <20091105031743.F29102388901@eris.apache.org> <5380c69c0911042103p7e227af3w8bae352b3925066e@mail.gmail.com> In-Reply-To: <5380c69c0911042103p7e227af3w8bae352b3925066e@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Claus, I was trying to use new IOException("xxx", ex), but it is new to JDK 1.6. So thanks for point that out, I will update the code to using the util method in the IOHelper. Cheers, Willem Claus Ibsen wrote: > Hi > > There is some code in Camel uitl to set the init cause when throwing > an IOException so it has the correct stacktrace. > What you do is just adding one giant big message. > > It should be something like this > > IOException cause = new IOException("xxxx"): > cause.initCause(e); > throw cause; > > > > On Thu, Nov 5, 2009 at 4:17 AM, wrote: >> Author: ningjiang >> Date: Thu Nov 5 03:17:43 2009 >> New Revision: 832981 >> >> URL: http://svn.apache.org/viewvc?rev=832981&view=rev >> Log: >> CAMEL-2129 throw the exception of camel ProduceTemplate in CamelConduit >> >> Modified: >> camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelConduit.java >> >> Modified: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelConduit.java >> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelConduit.java?rev=832981&r1=832980&r2=832981&view=diff >> ============================================================================== >> --- camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelConduit.java (original) >> +++ camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/CamelConduit.java Thu Nov 5 03:17:43 2009 >> @@ -17,12 +17,14 @@ >> package org.apache.camel.component.cxf.transport; >> >> import java.io.IOException; >> +import java.io.InputStream; >> import java.io.OutputStream; >> import java.util.logging.Level; >> import java.util.logging.Logger; >> >> import org.apache.camel.CamelContext; >> import org.apache.camel.ExchangePattern; >> +import org.apache.camel.InvalidPayloadException; >> import org.apache.camel.Processor; >> import org.apache.camel.ProducerTemplate; >> import org.apache.camel.component.cxf.CxfConstants; >> @@ -158,7 +160,7 @@ >> } >> >> >> - private void commitOutputMessage() { >> + private void commitOutputMessage() throws IOException { >> ExchangePattern pattern; >> if (isOneWay) { >> pattern = ExchangePattern.InOnly; >> @@ -179,15 +181,25 @@ >> } >> }); >> exchange.setProperty(CxfConstants.CXF_EXCHANGE, outMessage.getExchange()); >> + // Throw the exception that the template get >> + if (exchange.getException() != null) { >> + throw new IOException("Can't get the response message. Caused by " + exchange.getException()); >> + } >> if (!isOneWay) { >> handleResponse(exchange); >> } >> >> } >> >> - private void handleResponse(org.apache.camel.Exchange exchange) { >> - org.apache.cxf.message.Message inMessage = CxfSoapBinding.getCxfInMessage(headerFilterStrategy, >> + private void handleResponse(org.apache.camel.Exchange exchange) throws IOException { >> + org.apache.cxf.message.Message inMessage = null; >> + try { >> + inMessage = CxfSoapBinding.getCxfInMessage(headerFilterStrategy, >> exchange, true); >> + } catch (Exception ex) { >> + // Throw IOException here >> + throw new IOException("Can't get the response message. Caused by: " + ex); >> + } >> incomingObserver.onMessage(inMessage); >> } >> } >> >> >> > > >