Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 97893 invoked from network); 2 Jun 2009 05:27:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Jun 2009 05:27:08 -0000 Received: (qmail 85446 invoked by uid 500); 2 Jun 2009 05:27:20 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 85361 invoked by uid 500); 2 Jun 2009 05:27:20 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 85344 invoked by uid 99); 2 Jun 2009 05:27:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jun 2009 05:27:20 +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 claus.ibsen@gmail.com designates 209.85.220.177 as permitted sender) Received: from [209.85.220.177] (HELO mail-fx0-f177.google.com) (209.85.220.177) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jun 2009 05:27:08 +0000 Received: by fxm25 with SMTP id 25so7523010fxm.20 for ; Mon, 01 Jun 2009 22:26:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=VUXhTJAGoDZLntLbv4lorwqVXsdQ/bWeCoOpPyL9yoE=; b=rQi+1NqqeaZze38+SG5Iq7/b3K7Xeq3OJ0XCDN0+PgBv92Gn3gGzs8VA0piVZmi6J4 nF9Y01RfMbV0rzIjWRX6C2hkJm/QUO1EQjekDNeKLKt/jXAfV2v2cjgBHE21q7hf6UtG SK9guHa2X8QOGaDqZhdoPJh/y8wXMo6P6m7GE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=WSW606vafEvTjHDYvGoacnII/exLv0+mpBzfRCLeGd+EKaiUlS4Ycnij2Wn436ICMZ E6dxWGH3JkMg2/UgmNQXadoLzjNFnvi4whqq4D5ItTGQghz1FVG85Jdkk0BU36y6onSx tQOzxdIeZGX94fjazbkbI1FwY01nL8z+J4gAo= MIME-Version: 1.0 Received: by 10.223.110.3 with SMTP id l3mr3431437fap.48.1243920408074; Mon, 01 Jun 2009 22:26:48 -0700 (PDT) In-Reply-To: <23811650.post@talk.nabble.com> References: <23811650.post@talk.nabble.com> From: Claus Ibsen Date: Tue, 2 Jun 2009 07:26:28 +0200 Message-ID: <5380c69c0906012226q6883b3d2m4222d90395359599@mail.gmail.com> Subject: Re: Content message router conversion exception To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi You can add a convertBodyTo to force Camel to load your file and let the payload be a well known type the XPath can work with. Must obvious is to convert it to a String. So after the from() or just before the xpath you can do: .convertBodyTo(String.class) In Spring DSL its On Mon, Jun 1, 2009 at 11:44 AM, Andii wrote: > > I'm new in Camel. > I want to use content message router to process a message in different wa= ys > depending on data in message header. Input message countains in body user > defined (my) type (com.my.defined.type.Document). Before sending that > message as input to router I put some new data into header which are used= by > router to decide where the message should be passed (for example > document.file.size). I have following configuration: > > > > > > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0in:header('document.file.size') > 2= 0000 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > > > But when I try run that example I see following error > > 10:39:19,365 | ERROR | Component@674e9b | DeadLetterChannel =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0| > org.apache.camel.processor.Logger =A0203 | Failed delivery for exchangeId= : > ID-host/40757-1243842719103/0-12. On delivery attempt: 0 caught: > org.apache.camel.NoTypeConversionAvailableException: No type converter > available to convert from type: class > org.apache.camel.component.file.FileMessage to the required type: > org.w3c.dom.Document with value FileMessage: > inbox/upload-file-simple/MyFile.pdf > org.apache.camel.NoTypeConversionAvailableException: No type converter > available to convert from type: class > org.apache.camel.component.file.FileMessage to the required type: > org.w3c.dom.Document w > ith value FileMessage: inbox/upload-file-simple/MyFile.pdf > > > I guess that error may occur because message body is not a text (XML). If > it's true what should I do ? Use other EIP pattern ?? Or maybe put my obj= ect > to exchange attachement and leave empty body ? > > Many thanks for help > =A0Andrzej > > -- > View this message in context: http://www.nabble.com/Content-message-route= r-conversion-exception-tp23811650p23811650.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > --=20 Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus