Return-Path: Delivered-To: apmail-activemq-camel-user-archive@locus.apache.org Received: (qmail 72176 invoked from network); 22 Jul 2008 07:43:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Jul 2008 07:43:17 -0000 Received: (qmail 4306 invoked by uid 500); 22 Jul 2008 07:43:16 -0000 Delivered-To: apmail-activemq-camel-user-archive@activemq.apache.org Received: (qmail 4193 invoked by uid 500); 22 Jul 2008 07:43:16 -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 4182 invoked by uid 99); 22 Jul 2008 07:43:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jul 2008 00:43:16 -0700 X-ASF-Spam-Status: No, hits=2.4 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [68.230.241.41] (HELO fed1rmmtao105.cox.net) (68.230.241.41) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jul 2008 07:42:20 +0000 Received: from fed1rmimpo03.cox.net ([70.169.32.75]) by fed1rmmtao105.cox.net (InterMail vM.7.08.02.01 201-2186-121-102-20070209) with ESMTP id <20080722074246.DKHM774.fed1rmmtao105.cox.net@fed1rmimpo03.cox.net> for ; Tue, 22 Jul 2008 03:42:46 -0400 Received: from [192.168.0.10] ([70.181.128.238]) by fed1rmimpo03.cox.net with bizsmtp id svik1Z00858l3T204vikgV; Tue, 22 Jul 2008 03:42:45 -0400 Message-ID: <48858F74.2070301@cox.net> Date: Tue, 22 Jul 2008 00:42:44 -0700 From: Vadim Chekan User-Agent: Thunderbird 2.0.0.14 (X11/20080505) MIME-Version: 1.0 To: camel-user@activemq.apache.org Subject: Re: xstream usage References: <4C1FB9C00D24A140906239533638C4D204DBA14A@EXVS04.exserver.dk> In-Reply-To: <4C1FB9C00D24A140906239533638C4D204DBA14A@EXVS04.exserver.dk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Will work on better description for JIRA tomorrow. That's the problem: there was no errors. And xstream produced the body (exchange.getIn().getBody != null) but it was length==0. Vadim. Claus Ibsen wrote: > Hi Vadim > > Yes file a JIRA otherwise we will forget it. I hope we get a new feature in Camel 1.5 to be able to set encoding options on the camel context / route so type convertions to/from bytes can use the encoding settings specified. > > But fell free to add a JIRA, and if possible add a unit test that shows the bug. > > Isn't there any stacktrace or some evidence from camel-xstream that the marshal/unmarshal didn't work? > > The bug is solved much faster if you can provide a good start ;) > > > Med venlig hilsen > > Claus Ibsen > ...................................... > Silverbullet > Skovsg�rdsv�nget 21 > 8362 H�rning > Tlf. +45 2962 7576 > Web: www.silverbullet.dk > -----Original Message----- > From: Vadim Chekan [mailto:vchekan@cox.net] > Sent: 22. juli 2008 08:12 > To: camel-user@activemq.apache.org > Subject: Re: xstream usage > > Ah-ha! > Solved the mystery. > Apparently you should define -Dfile.encoding=UTF-8 in your > activemq.[bat|sh]. > IMHO it is a bug, when xstream silently fails to produce output. If it > does not like encoding settings, it should throw an exception. > > I already have discovered that this setting in Eclipse prevented me from > seeing xml output but I decided that it is because body of xml document > was a byte[] and I had no clue that xml writer will refuse to work with > non-unicode settings. > > Should I file JIRA issue? > > Vadim. > > > Claus Ibsen wrote: >> Hi >> >> Ah yeah the primitive types in arrays is printed with rather stupid names for its classname. You get the X[ stuff that looks as if something is wrong. >> >> Hmmm maybe we can improve Camel here to print a neater name for this ;) >> >> >> Med venlig hilsen >> >> Claus Ibsen >> ...................................... >> Silverbullet >> Skovsg�rdsv�nget 21 >> 8362 H�rning >> Tlf. +45 2962 7576 >> Web: www.silverbullet.dk >> -----Original Message----- >> From: Vadim Chekan [mailto:vchekan@cox.net] >> Sent: 22. juli 2008 06:40 >> To: camel-user@activemq.apache.org >> Subject: Re: xstream usage >> >> Yesh, that's what I did. As Claus advised I also inserted my own >> Processor to dump additional information. Apparently >> marshall().xstream() returns array of size 0. >> Too bad it works fine under Eclipse. I keep digging. Most likely it is >> something with classpath/libraries. >> >> To my surprise (most of my experience is c#) byte[].class.getName() >> returns "[B". At first I thought it is some binary garbage and only >> getCanonicalName clarified the situation :))) >> >> Vadim. >> >> James Strachan wrote: >>> Turning on the trace output can help see what the real payloads of the >>> messages are at each step of a route... >>> http://activemq.apache.org/camel/tracer.html >>> >>> 2008/7/20 Claus Ibsen : >>>> Hi >>>> >>>> You could add a process step where you can debug / log out your exchange. And 100% determine the body type. >>>> >>>> It does look like a strange body type? The code does after all just print its classname (albeit removing java.lang) for the standard types. >>>> >>>> Does it print the body content also? Looks like you cutted the logging short in this mail. >>>> >>>> >>>> Med venlig hilsen >>>> >>>> Claus Ibsen >>>> ...................................... >>>> Silverbullet >>>> Skovsg�rdsv�nget 21 >>>> 8362 H�rning >>>> Tlf. +45 2962 7576 >>>> Web: www.silverbullet.dk >>>> >>>> -----Original Message----- >>>> From: Vadim Chekan [mailto:kot.begemot@gmail.com] >>>> Sent: 19. juli 2008 23:35 >>>> To: camel-user@activemq.apache.org >>>> Subject: xstream usage >>>> >>>> I'm having problems with xstrem. I'm trying to convert jdbc output >>>> into xml and then extract a node I'm interested in. >>>> Host application: activemq-5.1.0 >>>> Camel: today's trunk build. >>>> Code: >>>> from("activemq:vadim33"). >>>> marshal(). >>>> xstream(). >>>> to("activemq:vadim44"); >>>> >>>> After marshaling I get some strange body "BodyType:[B Body:". I would >>>> expect xml dom object or xml text there. >>>> Any hints what the problem could be? >>>> >>>> 2008-07-19 14:26:12,141 [enerContainer-1] INFO TraceInterceptor >>>> - ID-vchekan/3625-1216502771610/1-1 -> interceptor2 >>>> Interceptor[Delegate(Pipeline[DeadLetterChannel[Delegate(TraceInterceptor[Marshal[org.apache.camel.model.dataformat.XStreamDataFormat@120540c]]), >>>> RecipientList[log:org.apache.camel.DeadLetterChannel?level=error], >>>> RedeliveryPolicy[maximumRedeliveries=6]], >>>> DeadLetterChannel[Delegate(TraceInterceptor[To[activemq:vadim44]]), >>>> RecipientList[log:org.apache.camel.DeadLetterChannel?level=error], >>>> RedeliveryPolicy[maximumRedeliveries=6]]])] InOnly Properties:{} >>>> Headers:{JMSXGroupID=null, JMSType=null, JMSCorrelationID=null, >>>> JMSMessageID=ID:vchekan-3550-1216502210018-2:0:1:1:2, JMSExpiration=0, >>>> JMSRedelivered=false, jdbc.columnCount=1, JMSDeliveryMode=2, >>>> JMSPriority=4, JMSTimestamp=1216502224862, JMSReplyTo=null, >>>> JMSDestination=queue://vadim33} BodyType:java.util.ArrayList >>>> Body:[{body=some text}] >>>> >>>> 2008-07-19 14:26:12,188 [enerContainer-1] INFO TraceInterceptor >>>> - ID-vchekan/3625-1216502771610/1-1 -> marshal1 >>>> Marshal[org.apache.camel.model.dataformat.XStreamDataFormat@120540c] >>>> InOnly Properties:{CamelCauseException=null} >>>> Headers:{JMSXGroupID=null, JMSType=null, JMSCorrelationID=null, >>>> JMSMessageID=ID:vchekan-3550-1216502210018-2:0:1:1:2, JMSExpiration=0, >>>> JMSRedelivered=false, jdbc.columnCount=1, JMSDeliveryMode=2, >>>> JMSPriority=4, JMSTimestamp=1216502224862, JMSReplyTo=null, >>>> JMSDestination=queue://vadim33} BodyType:java.util.ArrayList >>>> Body:[{some text}] >>>> >>>> 2008-07-19 14:26:12,391 [enerContainer-1] INFO TraceInterceptor >>>> - ID-vchekan/3625-1216502771610/1-1 -> to3 >>>> To[activemq:vadim44] InOnly Properties:{CamelCauseException=null} >>>> Headers:{JMSXGroupID=null, JMSType=null, JMSCorrelationID=null, >>>> JMSMessageID=ID:vchekan-3550-1216502210018-2:0:1:1:2, JMSExpiration=0, >>>> JMSRedelivered=false, jdbc.columnCount=1, JMSDeliveryMode=2, >>>> JMSPriority=4, JMSTimestamp=1216502224862, JMSReplyTo=null, >>>> JMSDestination=queue://vadim33} BodyType:[B Body: >>>> >>>> >>>> -- >>>> From RFC 2631: In ASN.1, EXPLICIT tagging is implicit unless IMPLICIT >>>> is explicitly specified >>>> >>> >> > >