Return-Path: Delivered-To: apmail-activemq-camel-user-archive@locus.apache.org Received: (qmail 3349 invoked from network); 17 Oct 2007 13:58:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Oct 2007 13:58:20 -0000 Received: (qmail 54535 invoked by uid 500); 17 Oct 2007 13:53:47 -0000 Delivered-To: apmail-activemq-camel-user-archive@activemq.apache.org Received: (qmail 54523 invoked by uid 500); 17 Oct 2007 13:53:46 -0000 Mailing-List: contact camel-user-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-user@activemq.apache.org Delivered-To: mailing list camel-user@activemq.apache.org Received: (qmail 54513 invoked by uid 99); 17 Oct 2007 13:53:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Oct 2007 06:53:46 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Oct 2007 13:53:48 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Ii9Ky-00043b-52 for camel-user@activemq.apache.org; Wed, 17 Oct 2007 06:53:28 -0700 Message-ID: <13254358.post@talk.nabble.com> Date: Wed, 17 Oct 2007 06:53:28 -0700 (PDT) From: jpcook To: camel-user@activemq.apache.org Subject: Re: InvalidPayloadException In-Reply-To: <13254216.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: jonathan.cook@erars.plus.com References: <13251961.post@talk.nabble.com> <13254216.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org I missed out: }); jpcook wrote: > > Sure. It is quite simple. > > public static void main(String args[]) throws Exception { > BasicConfigurator.configure(); > log = Logger.getLogger(Main.class); > > CamelContext context = new DefaultCamelContext(); > > context.addComponent("activemq", > > ActiveMQComponent.activeMQComponent("tcp://localhost:61616")); > > context.addRoutes(new RouteBuilder() { > > @Override > public void configure() { > from("activemq:test.queue") > .to("file://target"); > > CamelTemplate template = new CamelTemplate(context); > context.start(); > } > > I'm running activemq 4.1 in a separate window and then using JConsole to > submit a message to the test-queue queue. > > The message is consumed OK: > 7203 [DefaultMessageListenerContainer-7] DEBUG > org.springframework.jms.listener.DefaultMessageListenerContainer - > Received message of type [class > org.apache.activemq.command.ActiveMQTextMessage] from consumer > [ActiveMQMessageConsumer { value=ID:nol12791-3917-1192629082991-1:0:1:1, > started=true }] of session [ActiveMQSession > {id=ID:nol12791-3917-1192629082991-1:0:1,started=true}] > > I wondered if it was a problem outputting it to the file. > > Jonathan > > > James.Strachan wrote: >> >> On 17/10/2007, jpcook wrote: >>> >>> Hi, >>> >>> I am getting this error when trying to consume and write a simple text >>> message to file: >>> >>> 15234 [DefaultMessageListenerContainer-15] ERROR >>> org.apache.camel.processor.DeadLetterChannel - On delivery attempt: 0 >>> caught: org.apache.camel.InvalidPayloadException: No in body available >>> of >>> type: java.io.InputStream but has value: Hello World of type: >>> java.lang.String on the exchange: Exchange[FileMessage: target] >>> >>> I thought I might be able to use convertBodyTo(InputStream.class) but >>> that >>> doesn't seem to help >>> >>> Any help would be much appreciated. >> >> It sounds like a message doesn't have a body in it. Do you have an >> example of the Java code you were using to reproduce this? >> >> -- >> James >> ------- >> http://macstrac.blogspot.com/ >> >> Open Source SOA >> http://open.iona.com >> >> > > -- View this message in context: http://www.nabble.com/InvalidPayloadException-tf4640018s22882.html#a13254358 Sent from the Camel - Users mailing list archive at Nabble.com.