You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Tobias Emmerich <to...@gmx.de> on 2009/03/27 11:17:25 UTC

Jaxb Encoding

Hallo together,

i want to set the encoding from standart UTF-8 to iso-8859-15 in my "Camel
Root".

The source till now is like this:

<marshal>
   <jaxb id="myJaxb" prettyPrint="true" contextPath="acknowledgement"/>
</marshal>

i searched for somthing like:

<jaxb id="myJaxb" prettyPrint="true" contextPath="acknowledgement"
encoding="iso-8859-15"/>

Is there a standard way to set the encoding like this or is the only way
writing my on jaxb class?

Thanks for help

Tobias
-- 
View this message in context: http://www.nabble.com/Jaxb-Encoding-tp22738950p22738950.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Jaxb Encoding

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I am preparing to commit a fix in short time. Do you use Camel 2.0 or 1.x?

Would be great if you could test it in your end before I eg backport
the fix to 1.x



On Mon, Mar 30, 2009 at 10:51 AM, Tobias Emmerich
<to...@gmx.de> wrote:
>
> Is done :)
>
>
>
> Claus Ibsen-2 wrote:
>>
>> On Mon, Mar 30, 2009 at 10:22 AM, Tobias Emmerich
>> <to...@gmx.de> wrote:
>>>
>>> Hi Claus,
>>>
>>> thank you for your message.
>>>
>>> I can set the encoding in Jaxb with the marshaller:
>>>
>>> jaxb.getMarshaller().setProperty(Marshaller.JAXB_ENCODING,
>>> "iso-8859-15");
>>>
>>> But the problem is i don´t know how to set this in spring.
>>>
>>> Can you help me or some one else?
>> Hi
>>
>> Can you create a ticket in JIRA for this feature. Then we will get it
>> direclty in Camel so its easier for you to se the configuration.
>> http://camel.apache.org/support.html
>>
>> Then we can expose an attribute on the JAXBDataFormat where you can
>> set the encoding.
>>
>>>
>>> Thanks
>>>
>>> Tobias
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Jaxb-Encoding-tp22738950p22778303.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Jaxb-Encoding-tp22738950p22778732.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Jaxb Encoding

Posted by Tobias Emmerich <to...@gmx.de>.
Is done :)



Claus Ibsen-2 wrote:
> 
> On Mon, Mar 30, 2009 at 10:22 AM, Tobias Emmerich
> <to...@gmx.de> wrote:
>>
>> Hi Claus,
>>
>> thank you for your message.
>>
>> I can set the encoding in Jaxb with the marshaller:
>>
>> jaxb.getMarshaller().setProperty(Marshaller.JAXB_ENCODING,
>> "iso-8859-15");
>>
>> But the problem is i don´t know how to set this in spring.
>>
>> Can you help me or some one else?
> Hi
> 
> Can you create a ticket in JIRA for this feature. Then we will get it
> direclty in Camel so its easier for you to se the configuration.
> http://camel.apache.org/support.html
> 
> Then we can expose an attribute on the JAXBDataFormat where you can
> set the encoding.
> 
>>
>> Thanks
>>
>> Tobias
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Jaxb-Encoding-tp22738950p22778303.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 

-- 
View this message in context: http://www.nabble.com/Jaxb-Encoding-tp22738950p22778732.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Jaxb Encoding

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Mar 30, 2009 at 10:22 AM, Tobias Emmerich
<to...@gmx.de> wrote:
>
> Hi Claus,
>
> thank you for your message.
>
> I can set the encoding in Jaxb with the marshaller:
>
> jaxb.getMarshaller().setProperty(Marshaller.JAXB_ENCODING, "iso-8859-15");
>
> But the problem is i don´t know how to set this in spring.
>
> Can you help me or some one else?
Hi

Can you create a ticket in JIRA for this feature. Then we will get it
direclty in Camel so its easier for you to se the configuration.
http://camel.apache.org/support.html

Then we can expose an attribute on the JAXBDataFormat where you can
set the encoding.

>
> Thanks
>
> Tobias
>
> --
> View this message in context: http://www.nabble.com/Jaxb-Encoding-tp22738950p22778303.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Jaxb Encoding

Posted by Tobias Emmerich <to...@gmx.de>.
Hi Claus,

thank you for your message. 

I can set the encoding in Jaxb with the marshaller: 

jaxb.getMarshaller().setProperty(Marshaller.JAXB_ENCODING, "iso-8859-15");

But the problem is i don´t know how to set this in spring.

Can you help me or some one else?

Thanks

Tobias

-- 
View this message in context: http://www.nabble.com/Jaxb-Encoding-tp22738950p22778303.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Jaxb Encoding

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You want the XML outputted to write encodoing="iso-8859-1" in the XML
declaration?
Try checking the JAXB API how to set the encoding. That will help us.

You can set a Exchange property with the encoding, however not all
components/dataformats know this one.

There is a constant on Exchange.CHARSET_NAME you can set to the encoding name.

You can do this in your route
from...setProperty(Exchange.CHARSET_NAME, "iso-8859-1").marshal...

There is a Spring XML tag for it as well.

Maybe the JAXB data format already know it. I cant remember.
But checking how to set the encoding in JAXB is the key.



On Fri, Mar 27, 2009 at 11:17 AM, Tobias Emmerich
<to...@gmx.de> wrote:
>
> Hallo together,
>
> i want to set the encoding from standart UTF-8 to iso-8859-15 in my "Camel
> Root".
>
> The source till now is like this:
>
> <marshal>
>   <jaxb id="myJaxb" prettyPrint="true" contextPath="acknowledgement"/>
> </marshal>
>
> i searched for somthing like:
>
> <jaxb id="myJaxb" prettyPrint="true" contextPath="acknowledgement"
> encoding="iso-8859-15"/>
>
> Is there a standard way to set the encoding like this or is the only way
> writing my on jaxb class?
>
> Thanks for help
>
> Tobias
> --
> View this message in context: http://www.nabble.com/Jaxb-Encoding-tp22738950p22738950.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Jaxb Encoding

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Mar 30, 2009 at 11:57 AM, Tobias Emmerich
<to...@gmx.de> wrote:
>
> Hi,
>
> we use camel 1.5
Hi

I have fixed it in the next release, 1.6.1 and 2.0

In 1.5.0 you can might set the Marshaller on the JAXBComponent itself.
We did some fixes in 1.6.0 to the JAXB to cater for some concurrency
issues with JAXB itself in high loads.
So that changed the component not being able to set a custom
marshaller. You can maybe do that in the old 1.5.0 release.

You have to check yourself.
If so you should be able to define a spring bean as the data format
and use that instead of the build in JAXB.

Something like this:

<bean id="myJaxb" class="org.apache....JaxbDataFormat">
// use spring properties to set a custom marshaller where you have set
the encoding
</bean>



>
>
> --
> View this message in context: http://www.nabble.com/Jaxb-Encoding-tp22738950p22779773.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Jaxb Encoding

Posted by Tobias Emmerich <to...@gmx.de>.
Hi,

we use camel 1.5


-- 
View this message in context: http://www.nabble.com/Jaxb-Encoding-tp22738950p22779773.html
Sent from the Camel - Users mailing list archive at Nabble.com.