[jira] Created: (CAMEL-924) XmlWriter

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

[jira] Created: (CAMEL-924) XmlWriter

JIRA jira@apache.org
XmlWriter
----------

                 Key: CAMEL-924
                 URL: https://issues.apache.org/activemq/browse/CAMEL-924
             Project: Apache Camel
          Issue Type: Bug
    Affects Versions: 1.4.0
            Reporter: Vadim Chekan
            Priority: Critical


Related nabble:
http://www.nabble.com/xstream-marshalling-td19542712s22882.html

We need to fixate the xml writer created in camel-xstream via javax.xml.stream.XMLOutputFactory
(we need xstream component in Jira).
Otherwise factory falls into unpredictable writer and in case of com.sun.xml.internal.stream.XMLOutputFactoryImpl it refuses to work if file.encoding is set to something different then UTF-8.

May be propert implementation would be to attempt to use com.ctc.wstx.stax.WstxOutputFactory and if it fails, then produce a warning and use whatever is available.

Also for those who know what they are doing we can provide a setting in camel context which factory to use.

--
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-924) Xml factory in camel-xstream

JIRA jira@apache.org

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

Vadim Chekan updated CAMEL-924:
-------------------------------

    Summary: Xml factory in camel-xstream  (was: XmlWriter )

> Xml factory in camel-xstream
> ----------------------------
>
>                 Key: CAMEL-924
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-924
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 1.4.0
>            Reporter: Vadim Chekan
>            Priority: Critical
>
> Related nabble:
> http://www.nabble.com/xstream-marshalling-td19542712s22882.html
> We need to fixate the xml writer created in camel-xstream via javax.xml.stream.XMLOutputFactory
> (we need xstream component in Jira).
> Otherwise factory falls into unpredictable writer and in case of com.sun.xml.internal.stream.XMLOutputFactoryImpl it refuses to work if file.encoding is set to something different then UTF-8.
> May be propert implementation would be to attempt to use com.ctc.wstx.stax.WstxOutputFactory and if it fails, then produce a warning and use whatever is available.
> Also for those who know what they are doing we can provide a setting in camel context which factory to use.

--
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-924) Xml factory in camel-xstream

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

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

Claus Ibsen commented on CAMEL-924:
-----------------------------------

I think we need some kind of property you can set to use a fixed xml factory.

Vadim is there any API to set this? from a standard javax or from the XStream?

> Xml factory in camel-xstream
> ----------------------------
>
>                 Key: CAMEL-924
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-924
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 1.4.0
>            Reporter: Vadim Chekan
>            Priority: Critical
>
> Related nabble:
> http://www.nabble.com/xstream-marshalling-td19542712s22882.html
> We need to fixate the xml writer created in camel-xstream via javax.xml.stream.XMLOutputFactory
> (we need xstream component in Jira).
> Otherwise factory falls into unpredictable writer and in case of com.sun.xml.internal.stream.XMLOutputFactoryImpl it refuses to work if file.encoding is set to something different then UTF-8.
> May be propert implementation would be to attempt to use com.ctc.wstx.stax.WstxOutputFactory and if it fails, then produce a warning and use whatever is available.
> Also for those who know what they are doing we can provide a setting in camel context which factory to use.

--
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-924) Xml factory in camel-xstream

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

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

Claus Ibsen updated CAMEL-924:
------------------------------

    Component/s: camel-xstream

> Xml factory in camel-xstream
> ----------------------------
>
>                 Key: CAMEL-924
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-924
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-xstream
>    Affects Versions: 1.4.0
>            Reporter: Vadim Chekan
>
> Related nabble:
> http://www.nabble.com/xstream-marshalling-td19542712s22882.html
> We need to fixate the xml writer created in camel-xstream via javax.xml.stream.XMLOutputFactory
> (we need xstream component in Jira).
> Otherwise factory falls into unpredictable writer and in case of com.sun.xml.internal.stream.XMLOutputFactoryImpl it refuses to work if file.encoding is set to something different then UTF-8.
> May be propert implementation would be to attempt to use com.ctc.wstx.stax.WstxOutputFactory and if it fails, then produce a warning and use whatever is available.
> Also for those who know what they are doing we can provide a setting in camel context which factory to use.

--
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-924) Xml factory in camel-xstream

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

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

Claus Ibsen updated CAMEL-924:
------------------------------

    Priority: Major  (was: Critical)

> Xml factory in camel-xstream
> ----------------------------
>
>                 Key: CAMEL-924
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-924
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-xstream
>    Affects Versions: 1.4.0
>            Reporter: Vadim Chekan
>
> Related nabble:
> http://www.nabble.com/xstream-marshalling-td19542712s22882.html
> We need to fixate the xml writer created in camel-xstream via javax.xml.stream.XMLOutputFactory
> (we need xstream component in Jira).
> Otherwise factory falls into unpredictable writer and in case of com.sun.xml.internal.stream.XMLOutputFactoryImpl it refuses to work if file.encoding is set to something different then UTF-8.
> May be propert implementation would be to attempt to use com.ctc.wstx.stax.WstxOutputFactory and if it fails, then produce a warning and use whatever is available.
> Also for those who know what they are doing we can provide a setting in camel context which factory to use.

--
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] Assigned: (CAMEL-924) Xml factory in camel-xstream

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

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

Willem Jiang reassigned CAMEL-924:
----------------------------------

    Assignee: Willem Jiang

> Xml factory in camel-xstream
> ----------------------------
>
>                 Key: CAMEL-924
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-924
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-xstream
>    Affects Versions: 1.4.0
>            Reporter: Vadim Chekan
>            Assignee: Willem Jiang
>
> Related nabble:
> http://www.nabble.com/xstream-marshalling-td19542712s22882.html
> We need to fixate the xml writer created in camel-xstream via javax.xml.stream.XMLOutputFactory
> (we need xstream component in Jira).
> Otherwise factory falls into unpredictable writer and in case of com.sun.xml.internal.stream.XMLOutputFactoryImpl it refuses to work if file.encoding is set to something different then UTF-8.
> May be propert implementation would be to attempt to use com.ctc.wstx.stax.WstxOutputFactory and if it fails, then produce a warning and use whatever is available.
> Also for those who know what they are doing we can provide a setting in camel context which factory to use.

--
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-924) Xml factory in camel-xstream

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

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

Willem Jiang commented on CAMEL-924:
------------------------------------

I think this issue will not  appear on JDK 1.5, since the stax API begin to be a part of JDK since 1.6.
Here are the algorithm of XMLOutputFactory.newInstance() method determines the specific XMLInputFactory implementation class to load by using the following lookup procedure:
   1. Use the javax.xml.stream.XMLOutputFactory system property.
   2. Use the lib/xml.stream.properties file in the JRE directory.
   3. Use the Services API, if available, to determine the classname by looking in the META-INF/services/javax.xml.stream.XMLOutputFactory files in jars available to the JRE.
   4. Use the platform default XMLOutputFactory instance.

Since Camel just call the XStream lib to do the job, there is no explicate camel way(through URI) to do that,
so I suggest you set the XMLOutputFactoryImpl as you want through upper ways (I prefer the system property way more).

TODO We need to add this into Camel FAQ.

> Xml factory in camel-xstream
> ----------------------------
>
>                 Key: CAMEL-924
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-924
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-xstream
>    Affects Versions: 1.4.0
>            Reporter: Vadim Chekan
>            Assignee: Willem Jiang
>
> Related nabble:
> http://www.nabble.com/xstream-marshalling-td19542712s22882.html
> We need to fixate the xml writer created in camel-xstream via javax.xml.stream.XMLOutputFactory
> (we need xstream component in Jira).
> Otherwise factory falls into unpredictable writer and in case of com.sun.xml.internal.stream.XMLOutputFactoryImpl it refuses to work if file.encoding is set to something different then UTF-8.
> May be propert implementation would be to attempt to use com.ctc.wstx.stax.WstxOutputFactory and if it fails, then produce a warning and use whatever is available.
> Also for those who know what they are doing we can provide a setting in camel context which factory to use.

--
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-924) Xml factory in camel-xstream

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

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

Claus Ibsen commented on CAMEL-924:
-----------------------------------

Super work Willem.

I will add something to the wiki about how the factory is discovered in Java 1.5 then we can resolve this ticket.

> Xml factory in camel-xstream
> ----------------------------
>
>                 Key: CAMEL-924
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-924
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-xstream
>    Affects Versions: 1.4.0
>            Reporter: Vadim Chekan
>            Assignee: Willem Jiang
>
> Related nabble:
> http://www.nabble.com/xstream-marshalling-td19542712s22882.html
> We need to fixate the xml writer created in camel-xstream via javax.xml.stream.XMLOutputFactory
> (we need xstream component in Jira).
> Otherwise factory falls into unpredictable writer and in case of com.sun.xml.internal.stream.XMLOutputFactoryImpl it refuses to work if file.encoding is set to something different then UTF-8.
> May be propert implementation would be to attempt to use com.ctc.wstx.stax.WstxOutputFactory and if it fails, then produce a warning and use whatever is available.
> Also for those who know what they are doing we can provide a setting in camel context which factory to use.

--
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-924) Xml factory in camel-xstream

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

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

Claus Ibsen resolved CAMEL-924.
-------------------------------

    Resolution: Working as Designed

Updated wiki

http://cwiki.apache.org/confluence/display/CAMEL/XStream


> Xml factory in camel-xstream
> ----------------------------
>
>                 Key: CAMEL-924
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-924
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-xstream
>    Affects Versions: 1.4.0
>            Reporter: Vadim Chekan
>            Assignee: Willem Jiang
>
> Related nabble:
> http://www.nabble.com/xstream-marshalling-td19542712s22882.html
> We need to fixate the xml writer created in camel-xstream via javax.xml.stream.XMLOutputFactory
> (we need xstream component in Jira).
> Otherwise factory falls into unpredictable writer and in case of com.sun.xml.internal.stream.XMLOutputFactoryImpl it refuses to work if file.encoding is set to something different then UTF-8.
> May be propert implementation would be to attempt to use com.ctc.wstx.stax.WstxOutputFactory and if it fails, then produce a warning and use whatever is available.
> Also for those who know what they are doing we can provide a setting in camel context which factory to use.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.