[jira] Created: (CAMEL-744) xstream produces empty body

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (CAMEL-744) xstream produces empty body

JIRA jira@apache.org
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<HashMap<String, Object>> rows = new ArrayList<HashMap<String, Object>>();
                                HashMap<String, Object> row = new HashMap<String, Object>();
                                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:<?xml version="1.0" ?><list><map><entry><string>column1</string><string>Value 1</string></entry></map></list>
====================================================

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.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-744) xstream produces empty body

JIRA jira@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<HashMap<String, Object>> rows = new ArrayList<HashMap<String, Object>>();
> HashMap<String, Object> row = new HashMap<String, Object>();
> 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:<?xml version="1.0" ?><list><map><entry><string>column1</string><string>Value 1</string></entry></map></list>
> ====================================================
> 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.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-744) xstream produces empty body

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44525#action_44525 ]

Vadim Chekan commented on CAMEL-744:
------------------------------------

This is getting interesting Claus.
I've upgraded to trunk and I still can reproduce the issue.
In my output in eclipse there is no encoding in xml. But I get it in the test. And maven tests pass on my box.
So now I have 3 combinations: no body at all, xml without encoding and xml with encoding 8)
I keep working on it.

> 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<HashMap<String, Object>> rows = new ArrayList<HashMap<String, Object>>();
> HashMap<String, Object> row = new HashMap<String, Object>();
> 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:<?xml version="1.0" ?><list><map><entry><string>column1</string><string>Value 1</string></entry></map></list>
> ====================================================
> 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.

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (CAMEL-744) xstream produces empty body

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-744?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vadim Chekan resolved CAMEL-744.
--------------------------------

    Resolution: Fixed

Claus, looks like upgrade to xstream 1.3 solved the problem. After I refreshed my eclipse project and made sure that xstream-1.3.jar is loaded I have xml output with explicit encoding whichever file.encofing I set.
You can close the issue. Thanks!

> 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<HashMap<String, Object>> rows = new ArrayList<HashMap<String, Object>>();
> HashMap<String, Object> row = new HashMap<String, Object>();
> 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:<?xml version="1.0" ?><list><map><entry><string>column1</string><string>Value 1</string></entry></map></list>
> ====================================================
> 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.

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (CAMEL-744) xstream produces empty body

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-744?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vadim Chekan closed CAMEL-744.
------------------------------


Actually I can close it :)

> 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<HashMap<String, Object>> rows = new ArrayList<HashMap<String, Object>>();
> HashMap<String, Object> row = new HashMap<String, Object>();
> 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:<?xml version="1.0" ?><list><map><entry><string>column1</string><string>Value 1</string></entry></map></list>
> ====================================================
> 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.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (CAMEL-744) xstream produces empty body

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-744?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hadrian Zbarcea updated CAMEL-744:
----------------------------------

    Fix Version/s: 1.5.0

> 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
>             Fix For: 1.5.0
>
>
> 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<HashMap<String, Object>> rows = new ArrayList<HashMap<String, Object>>();
> HashMap<String, Object> row = new HashMap<String, Object>();
> 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:<?xml version="1.0" ?><list><map><entry><string>column1</string><string>Value 1</string></entry></map></list>
> ====================================================
> 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.