Return-Path: Delivered-To: apmail-activemq-camel-dev-archive@locus.apache.org Received: (qmail 69872 invoked from network); 24 Jul 2008 06:01:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Jul 2008 06:01:21 -0000 Received: (qmail 73968 invoked by uid 500); 24 Jul 2008 06:01:21 -0000 Delivered-To: apmail-activemq-camel-dev-archive@activemq.apache.org Received: (qmail 73946 invoked by uid 500); 24 Jul 2008 06:01:21 -0000 Mailing-List: contact camel-dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-dev@activemq.apache.org Delivered-To: mailing list camel-dev@activemq.apache.org Received: (qmail 73935 invoked by uid 99); 24 Jul 2008 06:01:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Jul 2008 23:01:21 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Jul 2008 06:00:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4B9AA234C179 for ; Wed, 23 Jul 2008 23:01:00 -0700 (PDT) Message-ID: <881201226.1216879260306.JavaMail.jira@brutus> Date: Wed, 23 Jul 2008 23:01:00 -0700 (PDT) From: "Claus Ibsen (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Commented: (CAMEL-744) xstream produces empty body In-Reply-To: <633501244.1216752781418.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/CAMEL-744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44497#action_44497 ] Claus Ibsen commented on CAMEL-744: ----------------------------------- Vadim I have tried to reproduce the bug but failed. I have added a unit test to camel-xstream component: MarshalListTest I have also upgraded the xstream .jars in the pom.xml to newer releases. So could you try it out with the 1.5-SNAPSHOT version? > xstream produces empty body > --------------------------- > > Key: CAMEL-744 > URL: https://issues.apache.org/activemq/browse/CAMEL-744 > Project: Apache Camel > Issue Type: Bug > Components: camel-stream > Affects Versions: 1.4.0 > Environment: Windows Server 2003; jdk1.6.0_06 > Reporter: Vadim Chekan > Priority: Critical > > 1. Set -Dfile.encoding=Cp1252 > 2. Set tracing ON. > 3. Run the code: > ==================================================== > from("timer://kickoff?period=10000"). > process(new Processor() { > public void process(Exchange exchange) throws Exception { > ArrayList> rows = new ArrayList>(); > HashMap row = new HashMap(); > row.put("column1", "Value 1"); > rows.add(row); > exchange.getOut().setBody(rows); > } > }). > marshal().xstream(). > to("mock:result"); > ==================================================== > 3. Observe output: > ==================================================== > Jul 22, 2008 11:35:28 AM org.apache.camel.processor.Logger process > INFO: ID-vchekan/4855-1216751728436/1-0 -> interceptor1 Interceptor[Delegate(Pipeline[DeadLetterChannel[Delegate(TraceInterceptor[Processor[enviance.org.test.MessageBrokerPackage$1@13e0aba]]), RecipientList[log:org.apache.camel.DeadLetterChannel?level=error], RedeliveryPolicy[maximumRedeliveries=6]], DeadLetterChannel[Delegate(TraceInterceptor[Marshal[org.apache.camel.model.dataformat.XStreamDataFormat@3257b8]]), RecipientList[log:org.apache.camel.DeadLetterChannel?level=error], RedeliveryPolicy[maximumRedeliveries=6]], DeadLetterChannel[Delegate(TraceInterceptor[To[mock:result]]), RecipientList[log:org.apache.camel.DeadLetterChannel?level=error], RedeliveryPolicy[maximumRedeliveries=6]]])] InOnly Properties:{org.apache.camel.timer.time=null, org.apache.camel.timer.period=10000, org.apache.camel.timer.name=kickoff} Headers:{} BodyType:null Body:Message: null > Jul 22, 2008 11:35:28 AM org.apache.camel.processor.Logger process > INFO: ID-vchekan/4855-1216751728436/1-0 -> processor1 Processor[enviance.org.test.MessageBrokerPackage$1@13e0aba] InOnly Properties:{org.apache.camel.timer.time=null, org.apache.camel.timer.period=10000, CamelCauseException=null, org.apache.camel.timer.name=kickoff} Headers:{} BodyType:null Body:Message: null > Jul 22, 2008 11:35:28 AM org.apache.camel.processor.Logger process > INFO: ID-vchekan/4855-1216751728436/1-0 -> marshal1 Marshal[org.apache.camel.model.dataformat.XStreamDataFormat@3257b8] InOnly Properties:{org.apache.camel.timer.time=null, org.apache.camel.timer.period=10000, CamelCauseException=null, org.apache.camel.timer.name=kickoff} Headers:{} BodyType:java.util.ArrayList Body:[{column1=Value 1}] > Jul 22, 2008 11:35:29 AM org.apache.camel.processor.Logger process > INFO: ID-vchekan/4855-1216751728436/1-0 -> to1 To[mock:result] InOnly Properties:{org.apache.camel.timer.time=null, org.apache.camel.timer.period=10000, CamelCauseException=null, org.apache.camel.timer.name=kickoff} Headers:{} BodyType:[B Body: > ==================================================== > As you see xstream returms an empty array (the end of the last line). > 4. Change encoding in step 1 to -Dfile.encoding=UTF-8 and re-run the application. > ==================================================== > Jul 22, 2008 11:40:18 AM org.apache.camel.processor.Logger process > INFO: ID-vchekan/4875-1216752017927/1-0 -> interceptor1 Interceptor[Delegate(Pipeline[DeadLetterChannel[Delegate(TraceInterceptor[Processor[enviance.org.test.MessageBrokerPackage$1@13e0aba]]), RecipientList[log:org.apache.camel.DeadLetterChannel?level=error], RedeliveryPolicy[maximumRedeliveries=6]], DeadLetterChannel[Delegate(TraceInterceptor[Marshal[org.apache.camel.model.dataformat.XStreamDataFormat@3257b8]]), RecipientList[log:org.apache.camel.DeadLetterChannel?level=error], RedeliveryPolicy[maximumRedeliveries=6]], DeadLetterChannel[Delegate(TraceInterceptor[To[mock:result]]), RecipientList[log:org.apache.camel.DeadLetterChannel?level=error], RedeliveryPolicy[maximumRedeliveries=6]]])] InOnly Properties:{org.apache.camel.timer.time=null, org.apache.camel.timer.period=10000, org.apache.camel.timer.name=kickoff} Headers:{} BodyType:null Body:Message: null > Jul 22, 2008 11:40:18 AM org.apache.camel.processor.Logger process > INFO: ID-vchekan/4875-1216752017927/1-0 -> processor1 Processor[enviance.org.test.MessageBrokerPackage$1@13e0aba] InOnly Properties:{org.apache.camel.timer.time=null, org.apache.camel.timer.period=10000, CamelCauseException=null, org.apache.camel.timer.name=kickoff} Headers:{} BodyType:null Body:Message: null > Jul 22, 2008 11:40:18 AM org.apache.camel.processor.Logger process > INFO: ID-vchekan/4875-1216752017927/1-0 -> marshal1 Marshal[org.apache.camel.model.dataformat.XStreamDataFormat@3257b8] InOnly Properties:{org.apache.camel.timer.time=null, org.apache.camel.timer.period=10000, CamelCauseException=null, org.apache.camel.timer.name=kickoff} Headers:{} BodyType:java.util.ArrayList Body:[{column1=Value 1}] > Jul 22, 2008 11:40:18 AM org.apache.camel.processor.Logger process > INFO: ID-vchekan/4875-1216752017927/1-0 -> to1 To[mock:result] InOnly Properties:{org.apache.camel.timer.time=null, org.apache.camel.timer.period=10000, CamelCauseException=null, org.apache.camel.timer.name=kickoff} Headers:{} BodyType:[B Body:column1Value 1 > ==================================================== > You see xml now. > I think it is a bug when xstream component silently refuses to work by producing empty output. It should either take into account configured encoding when producing output or explicitly refuse to work if encoding is "wrong" (throw an exception explaining the reasons of error). > Fixing this error is important because it affects at least 2 windows environments: Eclipse and ActiveMQ. > By default Eclipse on Windows has Cp1252 encoding set. > I do not know what encoding is set in ActiveMQ for Windows but it does not work unless activemq.bat is edited and encoding is explicitly set there. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.