How to change castor xml encoding using an XMLContext ?

View: New views
7 Messages — Rating Filter:   Alert me  

How to change castor xml encoding using an XMLContext ?

by Fernandez Pablo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi I have the following code and I want the response of the marshaller to be in UTF-16 (actually its in UTF-8 I think by default)

Code:
http://pastie.org/670624

I've tried to do marshaller.setEncoding('UTF-16') but I get an exception like this one:

java.lang.IllegalStateException: encoding cannot be set if you've passed in your own DocumentHandler at org.exolab.castor.xml.Marshaller.setEncoding(Marshaller.java:2387)

Thanks a lot!
--
Fernandez, Pablo.

Re: How to change castor xml encoding using an XMLContext ?

by Werner Guttmann-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Pablo,

can you please create a new Jira issue at

http://jira.codehaus.org/browse/CASTOR

and attach a minimal working test case.

Thanks in advance
Werner

pablo fernandez wrote:

> Hi I have the following code and I want the response of the marshaller to be
> in UTF-16 (actually its in UTF-8 I think by default)
>
> Code:
> http://pastie.org/670624
>
> I've tried to do marshaller.setEncoding('UTF-16') but I get an exception
> like this one:
>
> *java.lang.IllegalStateException: encoding cannot be set if you've passed in
> your own DocumentHandler at
> org.exolab.castor.xml.Marshaller.setEncoding(Marshaller.java:2387)*
>
> Thanks a lot!

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: How to change castor xml encoding using an XMLContext ?

by Werner Guttmann-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Actually, before doing so, can you please try to move the call to

setEncoding()

before any call to setWriter().

Regards
Werner

Werner Guttmann wrote:

> Hi Pablo,
>
> can you please create a new Jira issue at
>
> http://jira.codehaus.org/browse/CASTOR
>
> and attach a minimal working test case.
>
> Thanks in advance
> Werner
>
> pablo fernandez wrote:
>> Hi I have the following code and I want the response of the marshaller to be
>> in UTF-16 (actually its in UTF-8 I think by default)
>>
>> Code:
>> http://pastie.org/670624
>>
>> I've tried to do marshaller.setEncoding('UTF-16') but I get an exception
>> like this one:
>>
>> *java.lang.IllegalStateException: encoding cannot be set if you've passed in
>> your own DocumentHandler at
>> org.exolab.castor.xml.Marshaller.setEncoding(Marshaller.java:2387)*
>>
>> Thanks a lot!
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: How to change castor xml encoding using an XMLContext ?

by Fernandez Pablo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Werner,

It still throws that exception, I'll try to create the issue with the test case sometime today.

Do you use an specific test framework (TestNG, Junit 3 or 4) or anyone will do?

Thanks

On Tue, Nov 3, 2009 at 6:46 AM, Werner Guttmann <wguttmn@...> wrote:
Actually, before doing so, can you please try to move the call to

setEncoding()

before any call to setWriter().

Regards
Werner

Werner Guttmann wrote:
> Hi Pablo,
>
> can you please create a new Jira issue at
>
> http://jira.codehaus.org/browse/CASTOR
>
> and attach a minimal working test case.
>
> Thanks in advance
> Werner
>
> pablo fernandez wrote:
>> Hi I have the following code and I want the response of the marshaller to be
>> in UTF-16 (actually its in UTF-8 I think by default)
>>
>> Code:
>> http://pastie.org/670624
>>
>> I've tried to do marshaller.setEncoding('UTF-16') but I get an exception
>> like this one:
>>
>> *java.lang.IllegalStateException: encoding cannot be set if you've passed in
>> your own DocumentHandler at
>> org.exolab.castor.xml.Marshaller.setEncoding(Marshaller.java:2387)*
>>
>> Thanks a lot!
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
Fernandez, Pablo.

Re: How to change castor xml encoding using an XMLContext ?

by Werner Guttmann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Pablo,

JUnit 3 (or 4) would be preferable. And you could use one of the
available archetypes to facilitate your needs.

Regards
Werner

pablo fernandez wrote:

> Werner,
>
> It still throws that exception, I'll try to create the issue with the test
> case sometime today.
>
> Do you use an specific test framework (TestNG, Junit 3 or 4) or anyone will
> do?
>
> Thanks
>
> On Tue, Nov 3, 2009 at 6:46 AM, Werner Guttmann <wguttmn@...>wrote:
>
>> Actually, before doing so, can you please try to move the call to
>>
>> setEncoding()
>>
>> before any call to setWriter().
>>
>> Regards
>> Werner
>>
>> Werner Guttmann wrote:
>>> Hi Pablo,
>>>
>>> can you please create a new Jira issue at
>>>
>>> http://jira.codehaus.org/browse/CASTOR
>>>
>>> and attach a minimal working test case.
>>>
>>> Thanks in advance
>>> Werner
>>>
>>> pablo fernandez wrote:
>>>> Hi I have the following code and I want the response of the marshaller
>> to be
>>>> in UTF-16 (actually its in UTF-8 I think by default)
>>>>
>>>> Code:
>>>> http://pastie.org/670624
>>>>
>>>> I've tried to do marshaller.setEncoding('UTF-16') but I get an exception
>>>> like this one:
>>>>
>>>> *java.lang.IllegalStateException: encoding cannot be set if you've
>> passed in
>>>> your own DocumentHandler at
>>>> org.exolab.castor.xml.Marshaller.setEncoding(Marshaller.java:2387)*
>>>>
>>>> Thanks a lot!
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>>
>>>     http://xircles.codehaus.org/manage_email
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: How to change castor xml encoding using an XMLContext ?

by Fernandez Pablo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Werner,

I've already filed the issue and added the test case, please let me know about any updates.
http://jira.codehaus.org/browse/CASTOR-2846

Thanks.



On Wed, Nov 4, 2009 at 7:38 AM, Werner Guttmann <werner.guttmann@...> wrote:
Hi Pablo,

JUnit 3 (or 4) would be preferable. And you could use one of the
available archetypes to facilitate your needs.

Regards
Werner

pablo fernandez wrote:
> Werner,
>
> It still throws that exception, I'll try to create the issue with the test
> case sometime today.
>
> Do you use an specific test framework (TestNG, Junit 3 or 4) or anyone will
> do?
>
> Thanks
>
> On Tue, Nov 3, 2009 at 6:46 AM, Werner Guttmann <wguttmn@...>wrote:
>
>> Actually, before doing so, can you please try to move the call to
>>
>> setEncoding()
>>
>> before any call to setWriter().
>>
>> Regards
>> Werner
>>
>> Werner Guttmann wrote:
>>> Hi Pablo,
>>>
>>> can you please create a new Jira issue at
>>>
>>> http://jira.codehaus.org/browse/CASTOR
>>>
>>> and attach a minimal working test case.
>>>
>>> Thanks in advance
>>> Werner
>>>
>>> pablo fernandez wrote:
>>>> Hi I have the following code and I want the response of the marshaller
>> to be
>>>> in UTF-16 (actually its in UTF-8 I think by default)
>>>>
>>>> Code:
>>>> http://pastie.org/670624
>>>>
>>>> I've tried to do marshaller.setEncoding('UTF-16') but I get an exception
>>>> like this one:
>>>>
>>>> *java.lang.IllegalStateException: encoding cannot be set if you've
>> passed in
>>>> your own DocumentHandler at
>>>> org.exolab.castor.xml.Marshaller.setEncoding(Marshaller.java:2387)*
>>>>
>>>> Thanks a lot!
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>>
>>>     http://xircles.codehaus.org/manage_email
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
Fernandez, Pablo.

Re: How to change castor xml encoding using an XMLContext ?

by Werner Guttmann-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sure.

Werner

pablo fernandez wrote:

> Werner,
>
> I've already filed the issue and added the test case, please let me know
> about any updates.
> http://jira.codehaus.org/browse/CASTOR-2846
>
> Thanks.
>
>
>
> On Wed, Nov 4, 2009 at 7:38 AM, Werner Guttmann <werner.guttmann@...>wrote:
>
>> Hi Pablo,
>>
>> JUnit 3 (or 4) would be preferable. And you could use one of the
>> available archetypes to facilitate your needs.
>>
>> Regards
>> Werner
>>
>> pablo fernandez wrote:
>>> Werner,
>>>
>>> It still throws that exception, I'll try to create the issue with the
>> test
>>> case sometime today.
>>>
>>> Do you use an specific test framework (TestNG, Junit 3 or 4) or anyone
>> will
>>> do?
>>>
>>> Thanks
>>>
>>> On Tue, Nov 3, 2009 at 6:46 AM, Werner Guttmann <wguttmn@...
>>> wrote:
>>>
>>>> Actually, before doing so, can you please try to move the call to
>>>>
>>>> setEncoding()
>>>>
>>>> before any call to setWriter().
>>>>
>>>> Regards
>>>> Werner
>>>>
>>>> Werner Guttmann wrote:
>>>>> Hi Pablo,
>>>>>
>>>>> can you please create a new Jira issue at
>>>>>
>>>>> http://jira.codehaus.org/browse/CASTOR
>>>>>
>>>>> and attach a minimal working test case.
>>>>>
>>>>> Thanks in advance
>>>>> Werner
>>>>>
>>>>> pablo fernandez wrote:
>>>>>> Hi I have the following code and I want the response of the marshaller
>>>> to be
>>>>>> in UTF-16 (actually its in UTF-8 I think by default)
>>>>>>
>>>>>> Code:
>>>>>> http://pastie.org/670624
>>>>>>
>>>>>> I've tried to do marshaller.setEncoding('UTF-16') but I get an
>> exception
>>>>>> like this one:
>>>>>>
>>>>>> *java.lang.IllegalStateException: encoding cannot be set if you've
>>>> passed in
>>>>>> your own DocumentHandler at
>>>>>> org.exolab.castor.xml.Marshaller.setEncoding(Marshaller.java:2387)*
>>>>>>
>>>>>> Thanks a lot!
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe from this list, please visit:
>>>>>
>>>>>     http://xircles.codehaus.org/manage_email
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe from this list, please visit:
>>>>
>>>>    http://xircles.codehaus.org/manage_email
>>>>
>>>>
>>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email