You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Lars Eirik Rønning <la...@gmail.com> on 2008/10/29 09:38:45 UTC

Utf8 encoding with activemq 5.1

Hi.
I have a servlet which receives a post containing a utf8 encoded string.
When this string is pushed to the que it seems to be stored as another
characterset. When i use jaxb to autoprocess the xml from the que, i get an
exception relating to byte offset.
So far what i have done is used an outputstreamwriter and reencoded the
string with utf8. This semmes to work.. However this is not what we want.

When the servlet or in production the php client sends something to the que
, the que is not respecting the utf8 encoding either.
The orignal message is sendt from flex (which always uses utf8).

Any easy fix for this? We would like to remoe the intermediate step where we
now have to reencode the string.. Is this a common problem?

Re: Utf8 encoding with activemq 5.1

Posted by Lars Eirik Rønning <la...@gmail.com>.
Sorry to bother you guys again. It seemed i jumped the conclusion to quickly
yesterday..
We have now tried the following:
A flex client sends a textmessage which we have verified is utf8.
When i save this string to file it seems that it has become latin1.. We do
this by using editpad to check the encoding and have it converty to latin.

What i have had to do is wrap this string to a new string with an explicit
encoding of utf8. This seems to work fine. However this is not an option as
the stomp protocol will be used to send this textmessage from php.
Do yuo have any good ideas on how we can solve this?

I need to be ablet use characters in utf8 to solve my problem.
Lars..

On Wed, Oct 29, 2008 at 1:16 PM, Lars Eirik Rønning <la...@gmail.com>wrote:

> I think you are off the hook..;)Seems I need to create a new string which
> has the explicit utf8 encoding after i receive values from activemq.
>
> Thanks for helping
>
>
> On Wed, Oct 29, 2008 at 12:41 PM, Lars Eirik Rønning <la...@gmail.com>wrote:
>
>> But does this mean that when sending something over the wire using either
>> stomp or the regual wiringmethod for activemq that values are not respected
>> as utf8?
>> This seems strange.. Am i the first one who experiences this here..?
>>
>> Please give me a url so i can file a case if needed.
>>
>>
>> On Wed, Oct 29, 2008 at 12:06 PM, Dejan Bosanac <
>> dejan.bosanac@ttmsolutions.com> wrote:
>>
>>> Can you file a Jira issue, so somebody can take a look at it?
>>>
>>> Cheers
>>>
>>> --
>>> Dejan Bosanac
>>>
>>>
>>> http://www.ttmsolutions.com - get a free ActiveMQ user guide
>>>
>>> ActiveMQ in Action - http://www.manning.com/snyder/
>>> Scripting in Java - http://www.scriptinginjava.net
>>>
>>>
>>>
>>>
>>> � wrote:
>>> > When i tried to set the character encoding for mysql to utf8 using
>>> windows,
>>> > i did not get the error. (turned out that the operation which failed
>>> was a
>>> > alter, so it cannot be directly compared)
>>> >
>>> > However i still get the following exception when i receive the values
>>> from
>>> > activemq (this is somehow solved when i use the outputstreamwriter.. I
>>> do
>>> > not understand why..)
>>> >
>>> > javax.xml.bind.UnmarshalException
>>> >  - with linked exception:
>>> > [org.xml.sax.SAXParseException: Invalid byte 2 of 2-byte UTF-8
>>> sequence.]
>>> >
>>> > Anone able to help?
>>> >
>>> >
>>> >
>>> >
>>> > On Wed, Oct 29, 2008 at 11:34 AM, Lars Eirik Rønning <
>>> larseirik@gmail.com>wrote:
>>> >
>>> >
>>> >> This is the error we get:
>>> >>
>>> >> mysql> CREATE TABLE ACTIVEMQ_ACKS( CONTAINER VARCHAR(250) NOT NULL,
>>> >> SUB_DEST VARCHAR(250), CLIENT_ID VARCHAR(250) NOT NULL, SUB_NAME
>>> >> VARCHAR(250) NOT NULL, SELECTOR VARCHAR(250), LAST_ACKED_ID INTEGER,
>>> PRIMARY
>>> >> KEY ( CONTAINER, CLIENT_ID, SUB_NAME));
>>> >>
>>> >> ERROR 1071 (42000): Specified key was too long; max key length is 1000
>>> >> bytes
>>> >>
>>> >> On Wed, Oct 29, 2008 at 11:29 AM, Lars Eirik Rønning <
>>> larseirik@gmail.com>wrote:
>>> >>
>>> >>
>>> >>> we tried this but received an error when settin the character set to
>>> utf-8The
>>> >>> table ACTIVEMQ_ACKS failed.
>>> >>>
>>> >>> Any idea?
>>> >>>
>>> >>> On Wed, Oct 29, 2008 at 11:24 AM, Dejan Bosanac <
>>> >>> dejan.bosanac@ttmsolutions.com> wrote:
>>> >>>
>>> >>>
>>> >>>> Can you please try and let us know
>>> >>>>
>>> >>>> Cheers
>>> >>>>
>>> >>>> --
>>> >>>> Dejan Bosanac
>>> >>>>
>>> >>>>
>>> >>>> http://www.ttmsolutions.com - get a free ActiveMQ user guide
>>> >>>>
>>> >>>> ActiveMQ in Action - http://www.manning.com/snyder/
>>> >>>> Scripting in Java - http://www.scriptinginjava.net
>>> >>>>
>>> >>>>
>>> >>>>
>>> >>>> � wrote:
>>> >>>>
>>> >>>>> I realized that by default the db used is latin. Would this help if
>>> i
>>> >>>>>
>>> >>>> set
>>> >>>>
>>> >>>>> the db which received the values (we use jdbc persistency)
>>> >>>>> to utf8 instead of latin?
>>> >>>>>
>>> >>>>> On Wed, Oct 29, 2008 at 10:23 AM, Lars Eirik Rønning <
>>> >>>>>
>>> >>>> larseirik@gmail.com>wrote:
>>> >>>>
>>> >>>>>
>>> >>>>>> Well actually i would just like to take the xml which comes in and
>>> >>>>>>
>>> >>>> have
>>> >>>>
>>> >>>>>> this posted by my consumer.
>>> >>>>>>
>>> >>>>>> String myxml = request.getParameter("inputxml");
>>> >>>>>> sender.sendMessage(myxml);
>>> >>>>>>
>>> >>>>>> sender is a regular producer which uses the sendTextMessage method
>>> >>>>>>
>>> >>>> defined
>>> >>>>
>>> >>>>>> by the jms spec.
>>> >>>>>> Do i really need to do anything to this string if i just want to
>>> ship
>>> >>>>>>
>>> >>>> it to
>>> >>>>
>>> >>>>>> the que?
>>> >>>>>>
>>> >>>>>>
>>> >>>>>>
>>> >>>>>>
>>> >>>>>>
>>> >>>>>> On Wed, Oct 29, 2008 at 9:54 AM, Dejan Bosanac <
>>> >>>>>> dejan.bosanac@ttmsolutions.com> wrote:
>>> >>>>>>
>>> >>>>>>
>>> >>>>>>
>>> >>>>>>> Hi,
>>> >>>>>>>
>>> >>>>>>> can you post your code that creates and sends a message?
>>> >>>>>>>
>>> >>>>>>> Regards
>>> >>>>>>>
>>> >>>>>>> --
>>> >>>>>>> Dejan Bosanac
>>> >>>>>>>
>>> >>>>>>>
>>> >>>>>>> http://www.ttmsolutions.com - get a free ActiveMQ user guide
>>> >>>>>>>
>>> >>>>>>> ActiveMQ in Action - http://www.manning.com/snyder/
>>> >>>>>>> Scripting in Java - http://www.scriptinginjava.net
>>> >>>>>>>
>>> >>>>>>>
>>> >>>>>>>
>>> >>>>>>> � wrote:
>>> >>>>>>>
>>> >>>>>>>
>>> >>>>>>>> Hi.
>>> >>>>>>>> I have a servlet which receives a post containing a utf8 encoded
>>> >>>>>>>>
>>> >>>> string.
>>> >>>>
>>> >>>>>>>> When this string is pushed to the que it seems to be stored as
>>> >>>>>>>>
>>> >>>> another
>>> >>>>
>>> >>>>>>>> characterset. When i use jaxb to autoprocess the xml from the
>>> que, i
>>> >>>>>>>>
>>> >>>> get
>>> >>>>
>>> >>>>>>> an
>>> >>>>>>>
>>> >>>>>>>
>>> >>>>>>>> exception relating to byte offset.
>>> >>>>>>>> So far what i have done is used an outputstreamwriter and
>>> reencoded
>>> >>>>>>>>
>>> >>>> the
>>> >>>>
>>> >>>>>>>> string with utf8. This semmes to work.. However this is not what
>>> we
>>> >>>>>>>>
>>> >>>>>>>>
>>> >>>>>>> want.
>>> >>>>>>>
>>> >>>>>>>
>>> >>>>>>>> When the servlet or in production the php client sends something
>>> to
>>> >>>>>>>>
>>> >>>> the
>>> >>>>
>>> >>>>>>> que
>>> >>>>>>>
>>> >>>>>>>
>>> >>>>>>>> , the que is not respecting the utf8 encoding either.
>>> >>>>>>>> The orignal message is sendt from flex (which always uses utf8).
>>> >>>>>>>>
>>> >>>>>>>> Any easy fix for this? We would like to remoe the intermediate
>>> step
>>> >>>>>>>>
>>> >>>>>>>>
>>> >>>>>>> where we
>>> >>>>>>>
>>> >>>>>>>
>>> >>>>>>>> now have to reencode the string.. Is this a common problem?
>>> >>>>>>>>
>>> >>>>>>>>
>>> >>>>>>>>
>>> >>>>>>>>
>>> >>>>>>>
>>> >>>>
>>> >>>>
>>>
>>>
>>>
>>
>

Re: Utf8 encoding with activemq 5.1

Posted by Lars Eirik Rønning <la...@gmail.com>.
I think you are off the hook..;)Seems I need to create a new string which
has the explicit utf8 encoding after i receive values from activemq.

Thanks for helping

On Wed, Oct 29, 2008 at 12:41 PM, Lars Eirik Rønning <la...@gmail.com>wrote:

> But does this mean that when sending something over the wire using either
> stomp or the regual wiringmethod for activemq that values are not respected
> as utf8?
> This seems strange.. Am i the first one who experiences this here..?
>
> Please give me a url so i can file a case if needed.
>
>
> On Wed, Oct 29, 2008 at 12:06 PM, Dejan Bosanac <
> dejan.bosanac@ttmsolutions.com> wrote:
>
>> Can you file a Jira issue, so somebody can take a look at it?
>>
>> Cheers
>>
>> --
>> Dejan Bosanac
>>
>>
>> http://www.ttmsolutions.com - get a free ActiveMQ user guide
>>
>> ActiveMQ in Action - http://www.manning.com/snyder/
>> Scripting in Java - http://www.scriptinginjava.net
>>
>>
>>
>>
>> � wrote:
>> > When i tried to set the character encoding for mysql to utf8 using
>> windows,
>> > i did not get the error. (turned out that the operation which failed was
>> a
>> > alter, so it cannot be directly compared)
>> >
>> > However i still get the following exception when i receive the values
>> from
>> > activemq (this is somehow solved when i use the outputstreamwriter.. I
>> do
>> > not understand why..)
>> >
>> > javax.xml.bind.UnmarshalException
>> >  - with linked exception:
>> > [org.xml.sax.SAXParseException: Invalid byte 2 of 2-byte UTF-8
>> sequence.]
>> >
>> > Anone able to help?
>> >
>> >
>> >
>> >
>> > On Wed, Oct 29, 2008 at 11:34 AM, Lars Eirik Rønning <
>> larseirik@gmail.com>wrote:
>> >
>> >
>> >> This is the error we get:
>> >>
>> >> mysql> CREATE TABLE ACTIVEMQ_ACKS( CONTAINER VARCHAR(250) NOT NULL,
>> >> SUB_DEST VARCHAR(250), CLIENT_ID VARCHAR(250) NOT NULL, SUB_NAME
>> >> VARCHAR(250) NOT NULL, SELECTOR VARCHAR(250), LAST_ACKED_ID INTEGER,
>> PRIMARY
>> >> KEY ( CONTAINER, CLIENT_ID, SUB_NAME));
>> >>
>> >> ERROR 1071 (42000): Specified key was too long; max key length is 1000
>> >> bytes
>> >>
>> >> On Wed, Oct 29, 2008 at 11:29 AM, Lars Eirik Rønning <
>> larseirik@gmail.com>wrote:
>> >>
>> >>
>> >>> we tried this but received an error when settin the character set to
>> utf-8The
>> >>> table ACTIVEMQ_ACKS failed.
>> >>>
>> >>> Any idea?
>> >>>
>> >>> On Wed, Oct 29, 2008 at 11:24 AM, Dejan Bosanac <
>> >>> dejan.bosanac@ttmsolutions.com> wrote:
>> >>>
>> >>>
>> >>>> Can you please try and let us know
>> >>>>
>> >>>> Cheers
>> >>>>
>> >>>> --
>> >>>> Dejan Bosanac
>> >>>>
>> >>>>
>> >>>> http://www.ttmsolutions.com - get a free ActiveMQ user guide
>> >>>>
>> >>>> ActiveMQ in Action - http://www.manning.com/snyder/
>> >>>> Scripting in Java - http://www.scriptinginjava.net
>> >>>>
>> >>>>
>> >>>>
>> >>>> � wrote:
>> >>>>
>> >>>>> I realized that by default the db used is latin. Would this help if
>> i
>> >>>>>
>> >>>> set
>> >>>>
>> >>>>> the db which received the values (we use jdbc persistency)
>> >>>>> to utf8 instead of latin?
>> >>>>>
>> >>>>> On Wed, Oct 29, 2008 at 10:23 AM, Lars Eirik Rønning <
>> >>>>>
>> >>>> larseirik@gmail.com>wrote:
>> >>>>
>> >>>>>
>> >>>>>> Well actually i would just like to take the xml which comes in and
>> >>>>>>
>> >>>> have
>> >>>>
>> >>>>>> this posted by my consumer.
>> >>>>>>
>> >>>>>> String myxml = request.getParameter("inputxml");
>> >>>>>> sender.sendMessage(myxml);
>> >>>>>>
>> >>>>>> sender is a regular producer which uses the sendTextMessage method
>> >>>>>>
>> >>>> defined
>> >>>>
>> >>>>>> by the jms spec.
>> >>>>>> Do i really need to do anything to this string if i just want to
>> ship
>> >>>>>>
>> >>>> it to
>> >>>>
>> >>>>>> the que?
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>> On Wed, Oct 29, 2008 at 9:54 AM, Dejan Bosanac <
>> >>>>>> dejan.bosanac@ttmsolutions.com> wrote:
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>>> Hi,
>> >>>>>>>
>> >>>>>>> can you post your code that creates and sends a message?
>> >>>>>>>
>> >>>>>>> Regards
>> >>>>>>>
>> >>>>>>> --
>> >>>>>>> Dejan Bosanac
>> >>>>>>>
>> >>>>>>>
>> >>>>>>> http://www.ttmsolutions.com - get a free ActiveMQ user guide
>> >>>>>>>
>> >>>>>>> ActiveMQ in Action - http://www.manning.com/snyder/
>> >>>>>>> Scripting in Java - http://www.scriptinginjava.net
>> >>>>>>>
>> >>>>>>>
>> >>>>>>>
>> >>>>>>> � wrote:
>> >>>>>>>
>> >>>>>>>
>> >>>>>>>> Hi.
>> >>>>>>>> I have a servlet which receives a post containing a utf8 encoded
>> >>>>>>>>
>> >>>> string.
>> >>>>
>> >>>>>>>> When this string is pushed to the que it seems to be stored as
>> >>>>>>>>
>> >>>> another
>> >>>>
>> >>>>>>>> characterset. When i use jaxb to autoprocess the xml from the
>> que, i
>> >>>>>>>>
>> >>>> get
>> >>>>
>> >>>>>>> an
>> >>>>>>>
>> >>>>>>>
>> >>>>>>>> exception relating to byte offset.
>> >>>>>>>> So far what i have done is used an outputstreamwriter and
>> reencoded
>> >>>>>>>>
>> >>>> the
>> >>>>
>> >>>>>>>> string with utf8. This semmes to work.. However this is not what
>> we
>> >>>>>>>>
>> >>>>>>>>
>> >>>>>>> want.
>> >>>>>>>
>> >>>>>>>
>> >>>>>>>> When the servlet or in production the php client sends something
>> to
>> >>>>>>>>
>> >>>> the
>> >>>>
>> >>>>>>> que
>> >>>>>>>
>> >>>>>>>
>> >>>>>>>> , the que is not respecting the utf8 encoding either.
>> >>>>>>>> The orignal message is sendt from flex (which always uses utf8).
>> >>>>>>>>
>> >>>>>>>> Any easy fix for this? We would like to remoe the intermediate
>> step
>> >>>>>>>>
>> >>>>>>>>
>> >>>>>>> where we
>> >>>>>>>
>> >>>>>>>
>> >>>>>>>> now have to reencode the string.. Is this a common problem?
>> >>>>>>>>
>> >>>>>>>>
>> >>>>>>>>
>> >>>>>>>>
>> >>>>>>>
>> >>>>
>> >>>>
>>
>>
>>
>

Re: Utf8 encoding with activemq 5.1

Posted by Lars Eirik Rønning <la...@gmail.com>.
But does this mean that when sending something over the wire using either
stomp or the regual wiringmethod for activemq that values are not respected
as utf8?
This seems strange.. Am i the first one who experiences this here..?

Please give me a url so i can file a case if needed.

On Wed, Oct 29, 2008 at 12:06 PM, Dejan Bosanac <
dejan.bosanac@ttmsolutions.com> wrote:

> Can you file a Jira issue, so somebody can take a look at it?
>
> Cheers
>
> --
> Dejan Bosanac
>
>
> http://www.ttmsolutions.com - get a free ActiveMQ user guide
>
> ActiveMQ in Action - http://www.manning.com/snyder/
> Scripting in Java - http://www.scriptinginjava.net
>
>
>
>
> � wrote:
> > When i tried to set the character encoding for mysql to utf8 using
> windows,
> > i did not get the error. (turned out that the operation which failed was
> a
> > alter, so it cannot be directly compared)
> >
> > However i still get the following exception when i receive the values
> from
> > activemq (this is somehow solved when i use the outputstreamwriter.. I do
> > not understand why..)
> >
> > javax.xml.bind.UnmarshalException
> >  - with linked exception:
> > [org.xml.sax.SAXParseException: Invalid byte 2 of 2-byte UTF-8 sequence.]
> >
> > Anone able to help?
> >
> >
> >
> >
> > On Wed, Oct 29, 2008 at 11:34 AM, Lars Eirik Rønning <
> larseirik@gmail.com>wrote:
> >
> >
> >> This is the error we get:
> >>
> >> mysql> CREATE TABLE ACTIVEMQ_ACKS( CONTAINER VARCHAR(250) NOT NULL,
> >> SUB_DEST VARCHAR(250), CLIENT_ID VARCHAR(250) NOT NULL, SUB_NAME
> >> VARCHAR(250) NOT NULL, SELECTOR VARCHAR(250), LAST_ACKED_ID INTEGER,
> PRIMARY
> >> KEY ( CONTAINER, CLIENT_ID, SUB_NAME));
> >>
> >> ERROR 1071 (42000): Specified key was too long; max key length is 1000
> >> bytes
> >>
> >> On Wed, Oct 29, 2008 at 11:29 AM, Lars Eirik Rønning <
> larseirik@gmail.com>wrote:
> >>
> >>
> >>> we tried this but received an error when settin the character set to
> utf-8The
> >>> table ACTIVEMQ_ACKS failed.
> >>>
> >>> Any idea?
> >>>
> >>> On Wed, Oct 29, 2008 at 11:24 AM, Dejan Bosanac <
> >>> dejan.bosanac@ttmsolutions.com> wrote:
> >>>
> >>>
> >>>> Can you please try and let us know
> >>>>
> >>>> Cheers
> >>>>
> >>>> --
> >>>> Dejan Bosanac
> >>>>
> >>>>
> >>>> http://www.ttmsolutions.com - get a free ActiveMQ user guide
> >>>>
> >>>> ActiveMQ in Action - http://www.manning.com/snyder/
> >>>> Scripting in Java - http://www.scriptinginjava.net
> >>>>
> >>>>
> >>>>
> >>>> � wrote:
> >>>>
> >>>>> I realized that by default the db used is latin. Would this help if i
> >>>>>
> >>>> set
> >>>>
> >>>>> the db which received the values (we use jdbc persistency)
> >>>>> to utf8 instead of latin?
> >>>>>
> >>>>> On Wed, Oct 29, 2008 at 10:23 AM, Lars Eirik Rønning <
> >>>>>
> >>>> larseirik@gmail.com>wrote:
> >>>>
> >>>>>
> >>>>>> Well actually i would just like to take the xml which comes in and
> >>>>>>
> >>>> have
> >>>>
> >>>>>> this posted by my consumer.
> >>>>>>
> >>>>>> String myxml = request.getParameter("inputxml");
> >>>>>> sender.sendMessage(myxml);
> >>>>>>
> >>>>>> sender is a regular producer which uses the sendTextMessage method
> >>>>>>
> >>>> defined
> >>>>
> >>>>>> by the jms spec.
> >>>>>> Do i really need to do anything to this string if i just want to
> ship
> >>>>>>
> >>>> it to
> >>>>
> >>>>>> the que?
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> On Wed, Oct 29, 2008 at 9:54 AM, Dejan Bosanac <
> >>>>>> dejan.bosanac@ttmsolutions.com> wrote:
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>> Hi,
> >>>>>>>
> >>>>>>> can you post your code that creates and sends a message?
> >>>>>>>
> >>>>>>> Regards
> >>>>>>>
> >>>>>>> --
> >>>>>>> Dejan Bosanac
> >>>>>>>
> >>>>>>>
> >>>>>>> http://www.ttmsolutions.com - get a free ActiveMQ user guide
> >>>>>>>
> >>>>>>> ActiveMQ in Action - http://www.manning.com/snyder/
> >>>>>>> Scripting in Java - http://www.scriptinginjava.net
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> � wrote:
> >>>>>>>
> >>>>>>>
> >>>>>>>> Hi.
> >>>>>>>> I have a servlet which receives a post containing a utf8 encoded
> >>>>>>>>
> >>>> string.
> >>>>
> >>>>>>>> When this string is pushed to the que it seems to be stored as
> >>>>>>>>
> >>>> another
> >>>>
> >>>>>>>> characterset. When i use jaxb to autoprocess the xml from the que,
> i
> >>>>>>>>
> >>>> get
> >>>>
> >>>>>>> an
> >>>>>>>
> >>>>>>>
> >>>>>>>> exception relating to byte offset.
> >>>>>>>> So far what i have done is used an outputstreamwriter and
> reencoded
> >>>>>>>>
> >>>> the
> >>>>
> >>>>>>>> string with utf8. This semmes to work.. However this is not what
> we
> >>>>>>>>
> >>>>>>>>
> >>>>>>> want.
> >>>>>>>
> >>>>>>>
> >>>>>>>> When the servlet or in production the php client sends something
> to
> >>>>>>>>
> >>>> the
> >>>>
> >>>>>>> que
> >>>>>>>
> >>>>>>>
> >>>>>>>> , the que is not respecting the utf8 encoding either.
> >>>>>>>> The orignal message is sendt from flex (which always uses utf8).
> >>>>>>>>
> >>>>>>>> Any easy fix for this? We would like to remoe the intermediate
> step
> >>>>>>>>
> >>>>>>>>
> >>>>>>> where we
> >>>>>>>
> >>>>>>>
> >>>>>>>> now have to reencode the string.. Is this a common problem?
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>
> >>>>
> >>>>
>
>
>

Re: Utf8 encoding with activemq 5.1

Posted by Dejan Bosanac <de...@ttmsolutions.com>.
Can you file a Jira issue, so somebody can take a look at it?

Cheers

-- 
Dejan Bosanac


http://www.ttmsolutions.com - get a free ActiveMQ user guide

ActiveMQ in Action - http://www.manning.com/snyder/
Scripting in Java - http://www.scriptinginjava.net




� wrote:
> When i tried to set the character encoding for mysql to utf8 using windows,
> i did not get the error. (turned out that the operation which failed was a
> alter, so it cannot be directly compared)
>
> However i still get the following exception when i receive the values from
> activemq (this is somehow solved when i use the outputstreamwriter.. I do
> not understand why..)
>
> javax.xml.bind.UnmarshalException
>  - with linked exception:
> [org.xml.sax.SAXParseException: Invalid byte 2 of 2-byte UTF-8 sequence.]
>
> Anone able to help?
>
>
>
>
> On Wed, Oct 29, 2008 at 11:34 AM, Lars Eirik Rønning <la...@gmail.com>wrote:
>
>   
>> This is the error we get:
>>
>> mysql> CREATE TABLE ACTIVEMQ_ACKS( CONTAINER VARCHAR(250) NOT NULL,
>> SUB_DEST VARCHAR(250), CLIENT_ID VARCHAR(250) NOT NULL, SUB_NAME
>> VARCHAR(250) NOT NULL, SELECTOR VARCHAR(250), LAST_ACKED_ID INTEGER, PRIMARY
>> KEY ( CONTAINER, CLIENT_ID, SUB_NAME));
>>
>> ERROR 1071 (42000): Specified key was too long; max key length is 1000
>> bytes
>>
>> On Wed, Oct 29, 2008 at 11:29 AM, Lars Eirik Rønning <la...@gmail.com>wrote:
>>
>>     
>>> we tried this but received an error when settin the character set to utf-8The
>>> table ACTIVEMQ_ACKS failed.
>>>
>>> Any idea?
>>>
>>> On Wed, Oct 29, 2008 at 11:24 AM, Dejan Bosanac <
>>> dejan.bosanac@ttmsolutions.com> wrote:
>>>
>>>       
>>>> Can you please try and let us know
>>>>
>>>> Cheers
>>>>
>>>> --
>>>> Dejan Bosanac
>>>>
>>>>
>>>> http://www.ttmsolutions.com - get a free ActiveMQ user guide
>>>>
>>>> ActiveMQ in Action - http://www.manning.com/snyder/
>>>> Scripting in Java - http://www.scriptinginjava.net
>>>>
>>>>
>>>>
>>>> � wrote:
>>>>         
>>>>> I realized that by default the db used is latin. Would this help if i
>>>>>           
>>>> set
>>>>         
>>>>> the db which received the values (we use jdbc persistency)
>>>>> to utf8 instead of latin?
>>>>>
>>>>> On Wed, Oct 29, 2008 at 10:23 AM, Lars Eirik Rønning <
>>>>>           
>>>> larseirik@gmail.com>wrote:
>>>>         
>>>>>           
>>>>>> Well actually i would just like to take the xml which comes in and
>>>>>>             
>>>> have
>>>>         
>>>>>> this posted by my consumer.
>>>>>>
>>>>>> String myxml = request.getParameter("inputxml");
>>>>>> sender.sendMessage(myxml);
>>>>>>
>>>>>> sender is a regular producer which uses the sendTextMessage method
>>>>>>             
>>>> defined
>>>>         
>>>>>> by the jms spec.
>>>>>> Do i really need to do anything to this string if i just want to ship
>>>>>>             
>>>> it to
>>>>         
>>>>>> the que?
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Wed, Oct 29, 2008 at 9:54 AM, Dejan Bosanac <
>>>>>> dejan.bosanac@ttmsolutions.com> wrote:
>>>>>>
>>>>>>
>>>>>>             
>>>>>>> Hi,
>>>>>>>
>>>>>>> can you post your code that creates and sends a message?
>>>>>>>
>>>>>>> Regards
>>>>>>>
>>>>>>> --
>>>>>>> Dejan Bosanac
>>>>>>>
>>>>>>>
>>>>>>> http://www.ttmsolutions.com - get a free ActiveMQ user guide
>>>>>>>
>>>>>>> ActiveMQ in Action - http://www.manning.com/snyder/
>>>>>>> Scripting in Java - http://www.scriptinginjava.net
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> � wrote:
>>>>>>>
>>>>>>>               
>>>>>>>> Hi.
>>>>>>>> I have a servlet which receives a post containing a utf8 encoded
>>>>>>>>                 
>>>> string.
>>>>         
>>>>>>>> When this string is pushed to the que it seems to be stored as
>>>>>>>>                 
>>>> another
>>>>         
>>>>>>>> characterset. When i use jaxb to autoprocess the xml from the que, i
>>>>>>>>                 
>>>> get
>>>>         
>>>>>>> an
>>>>>>>
>>>>>>>               
>>>>>>>> exception relating to byte offset.
>>>>>>>> So far what i have done is used an outputstreamwriter and reencoded
>>>>>>>>                 
>>>> the
>>>>         
>>>>>>>> string with utf8. This semmes to work.. However this is not what we
>>>>>>>>
>>>>>>>>                 
>>>>>>> want.
>>>>>>>
>>>>>>>               
>>>>>>>> When the servlet or in production the php client sends something to
>>>>>>>>                 
>>>> the
>>>>         
>>>>>>> que
>>>>>>>
>>>>>>>               
>>>>>>>> , the que is not respecting the utf8 encoding either.
>>>>>>>> The orignal message is sendt from flex (which always uses utf8).
>>>>>>>>
>>>>>>>> Any easy fix for this? We would like to remoe the intermediate step
>>>>>>>>
>>>>>>>>                 
>>>>>>> where we
>>>>>>>
>>>>>>>               
>>>>>>>> now have to reencode the string.. Is this a common problem?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>                 
>>>>>>>               
>>>>
>>>>         



Re: Utf8 encoding with activemq 5.1

Posted by Lars Eirik Rønning <la...@gmail.com>.
When i tried to set the character encoding for mysql to utf8 using windows,
i did not get the error. (turned out that the operation which failed was a
alter, so it cannot be directly compared)

However i still get the following exception when i receive the values from
activemq (this is somehow solved when i use the outputstreamwriter.. I do
not understand why..)

javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException: Invalid byte 2 of 2-byte UTF-8 sequence.]

Anone able to help?




On Wed, Oct 29, 2008 at 11:34 AM, Lars Eirik Rønning <la...@gmail.com>wrote:

> This is the error we get:
>
> mysql> CREATE TABLE ACTIVEMQ_ACKS( CONTAINER VARCHAR(250) NOT NULL,
> SUB_DEST VARCHAR(250), CLIENT_ID VARCHAR(250) NOT NULL, SUB_NAME
> VARCHAR(250) NOT NULL, SELECTOR VARCHAR(250), LAST_ACKED_ID INTEGER, PRIMARY
> KEY ( CONTAINER, CLIENT_ID, SUB_NAME));
>
> ERROR 1071 (42000): Specified key was too long; max key length is 1000
> bytes
>
> On Wed, Oct 29, 2008 at 11:29 AM, Lars Eirik Rønning <la...@gmail.com>wrote:
>
>> we tried this but received an error when settin the character set to utf-8The
>> table ACTIVEMQ_ACKS failed.
>>
>> Any idea?
>>
>> On Wed, Oct 29, 2008 at 11:24 AM, Dejan Bosanac <
>> dejan.bosanac@ttmsolutions.com> wrote:
>>
>>> Can you please try and let us know
>>>
>>> Cheers
>>>
>>> --
>>> Dejan Bosanac
>>>
>>>
>>> http://www.ttmsolutions.com - get a free ActiveMQ user guide
>>>
>>> ActiveMQ in Action - http://www.manning.com/snyder/
>>> Scripting in Java - http://www.scriptinginjava.net
>>>
>>>
>>>
>>> � wrote:
>>> > I realized that by default the db used is latin. Would this help if i
>>> set
>>> > the db which received the values (we use jdbc persistency)
>>> > to utf8 instead of latin?
>>> >
>>> > On Wed, Oct 29, 2008 at 10:23 AM, Lars Eirik Rønning <
>>> larseirik@gmail.com>wrote:
>>> >
>>> >
>>> >> Well actually i would just like to take the xml which comes in and
>>> have
>>> >> this posted by my consumer.
>>> >>
>>> >> String myxml = request.getParameter("inputxml");
>>> >> sender.sendMessage(myxml);
>>> >>
>>> >> sender is a regular producer which uses the sendTextMessage method
>>> defined
>>> >> by the jms spec.
>>> >> Do i really need to do anything to this string if i just want to ship
>>> it to
>>> >> the que?
>>> >>
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> On Wed, Oct 29, 2008 at 9:54 AM, Dejan Bosanac <
>>> >> dejan.bosanac@ttmsolutions.com> wrote:
>>> >>
>>> >>
>>> >>> Hi,
>>> >>>
>>> >>> can you post your code that creates and sends a message?
>>> >>>
>>> >>> Regards
>>> >>>
>>> >>> --
>>> >>> Dejan Bosanac
>>> >>>
>>> >>>
>>> >>> http://www.ttmsolutions.com - get a free ActiveMQ user guide
>>> >>>
>>> >>> ActiveMQ in Action - http://www.manning.com/snyder/
>>> >>> Scripting in Java - http://www.scriptinginjava.net
>>> >>>
>>> >>>
>>> >>>
>>> >>> � wrote:
>>> >>>
>>> >>>> Hi.
>>> >>>> I have a servlet which receives a post containing a utf8 encoded
>>> string.
>>> >>>> When this string is pushed to the que it seems to be stored as
>>> another
>>> >>>> characterset. When i use jaxb to autoprocess the xml from the que, i
>>> get
>>> >>>>
>>> >>> an
>>> >>>
>>> >>>> exception relating to byte offset.
>>> >>>> So far what i have done is used an outputstreamwriter and reencoded
>>> the
>>> >>>> string with utf8. This semmes to work.. However this is not what we
>>> >>>>
>>> >>> want.
>>> >>>
>>> >>>> When the servlet or in production the php client sends something to
>>> the
>>> >>>>
>>> >>> que
>>> >>>
>>> >>>> , the que is not respecting the utf8 encoding either.
>>> >>>> The orignal message is sendt from flex (which always uses utf8).
>>> >>>>
>>> >>>> Any easy fix for this? We would like to remoe the intermediate step
>>> >>>>
>>> >>> where we
>>> >>>
>>> >>>> now have to reencode the string.. Is this a common problem?
>>> >>>>
>>> >>>>
>>> >>>>
>>> >>>
>>> >>>
>>>
>>>
>>>
>>
>

Re: Utf8 encoding with activemq 5.1

Posted by Dejan Bosanac <de...@ttmsolutions.com>.
This a MySQL limitation. You have two options,
 
- set the size of fields that creates the primary key on some smaller
value (say 100)
- create this table in latin1 by adding  "DEFAULT CHARACTER SET latin1"
at the end of query. This should work fine, since this table has nothing
to do with content of the message.

Cheers

--
Dejan Bosanac


http://www.ttmsolutions.com - get a free ActiveMQ user guide

ActiveMQ in Action - http://www.manning.com/snyder/
Scripting in Java - http://www.scriptinginjava.net



� wrote:
> This is the error we get:
>
> mysql> CREATE TABLE ACTIVEMQ_ACKS( CONTAINER VARCHAR(250) NOT NULL, SUB_DEST
> VARCHAR(250), CLIENT_ID VARCHAR(250) NOT NULL, SUB_NAME VARCHAR(250) NOT
> NULL, SELECTOR VARCHAR(250), LAST_ACKED_ID INTEGER, PRIMARY KEY ( CONTAINER,
> CLIENT_ID, SUB_NAME));
>
> ERROR 1071 (42000): Specified key was too long; max key length is 1000 bytes
>
> On Wed, Oct 29, 2008 at 11:29 AM, Lars Eirik Rønning <la...@gmail.com>wrote:
>
>   
>> we tried this but received an error when settin the character set to utf-8The
>> table ACTIVEMQ_ACKS failed.
>>
>> Any idea?
>>
>> On Wed, Oct 29, 2008 at 11:24 AM, Dejan Bosanac <
>> dejan.bosanac@ttmsolutions.com> wrote:
>>
>>     
>>> Can you please try and let us know
>>>
>>> Cheers
>>>
>>> --
>>> Dejan Bosanac
>>>
>>>
>>> http://www.ttmsolutions.com - get a free ActiveMQ user guide
>>>
>>> ActiveMQ in Action - http://www.manning.com/snyder/
>>> Scripting in Java - http://www.scriptinginjava.net
>>>
>>>
>>>
>>> � wrote:
>>>       
>>>> I realized that by default the db used is latin. Would this help if i
>>>>         
>>> set
>>>       
>>>> the db which received the values (we use jdbc persistency)
>>>> to utf8 instead of latin?
>>>>
>>>> On Wed, Oct 29, 2008 at 10:23 AM, Lars Eirik Rønning <
>>>>         
>>> larseirik@gmail.com>wrote:
>>>       
>>>>         
>>>>> Well actually i would just like to take the xml which comes in and have
>>>>> this posted by my consumer.
>>>>>
>>>>> String myxml = request.getParameter("inputxml");
>>>>> sender.sendMessage(myxml);
>>>>>
>>>>> sender is a regular producer which uses the sendTextMessage method
>>>>>           
>>> defined
>>>       
>>>>> by the jms spec.
>>>>> Do i really need to do anything to this string if i just want to ship
>>>>>           
>>> it to
>>>       
>>>>> the que?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Oct 29, 2008 at 9:54 AM, Dejan Bosanac <
>>>>> dejan.bosanac@ttmsolutions.com> wrote:
>>>>>
>>>>>
>>>>>           
>>>>>> Hi,
>>>>>>
>>>>>> can you post your code that creates and sends a message?
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>> --
>>>>>> Dejan Bosanac
>>>>>>
>>>>>>
>>>>>> http://www.ttmsolutions.com - get a free ActiveMQ user guide
>>>>>>
>>>>>> ActiveMQ in Action - http://www.manning.com/snyder/
>>>>>> Scripting in Java - http://www.scriptinginjava.net
>>>>>>
>>>>>>
>>>>>>
>>>>>> � wrote:
>>>>>>
>>>>>>             
>>>>>>> Hi.
>>>>>>> I have a servlet which receives a post containing a utf8 encoded
>>>>>>>               
>>> string.
>>>       
>>>>>>> When this string is pushed to the que it seems to be stored as
>>>>>>>               
>>> another
>>>       
>>>>>>> characterset. When i use jaxb to autoprocess the xml from the que, i
>>>>>>>               
>>> get
>>>       
>>>>>> an
>>>>>>
>>>>>>             
>>>>>>> exception relating to byte offset.
>>>>>>> So far what i have done is used an outputstreamwriter and reencoded
>>>>>>>               
>>> the
>>>       
>>>>>>> string with utf8. This semmes to work.. However this is not what we
>>>>>>>
>>>>>>>               
>>>>>> want.
>>>>>>
>>>>>>             
>>>>>>> When the servlet or in production the php client sends something to
>>>>>>>               
>>> the
>>>       
>>>>>> que
>>>>>>
>>>>>>             
>>>>>>> , the que is not respecting the utf8 encoding either.
>>>>>>> The orignal message is sendt from flex (which always uses utf8).
>>>>>>>
>>>>>>> Any easy fix for this? We would like to remoe the intermediate step
>>>>>>>
>>>>>>>               
>>>>>> where we
>>>>>>
>>>>>>             
>>>>>>> now have to reencode the string.. Is this a common problem?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>>             
>>>
>>>       



Re: Utf8 encoding with activemq 5.1

Posted by Lars Eirik Rønning <la...@gmail.com>.
This is the error we get:

mysql> CREATE TABLE ACTIVEMQ_ACKS( CONTAINER VARCHAR(250) NOT NULL, SUB_DEST
VARCHAR(250), CLIENT_ID VARCHAR(250) NOT NULL, SUB_NAME VARCHAR(250) NOT
NULL, SELECTOR VARCHAR(250), LAST_ACKED_ID INTEGER, PRIMARY KEY ( CONTAINER,
CLIENT_ID, SUB_NAME));

ERROR 1071 (42000): Specified key was too long; max key length is 1000 bytes

On Wed, Oct 29, 2008 at 11:29 AM, Lars Eirik Rønning <la...@gmail.com>wrote:

> we tried this but received an error when settin the character set to utf-8The
> table ACTIVEMQ_ACKS failed.
>
> Any idea?
>
> On Wed, Oct 29, 2008 at 11:24 AM, Dejan Bosanac <
> dejan.bosanac@ttmsolutions.com> wrote:
>
>> Can you please try and let us know
>>
>> Cheers
>>
>> --
>> Dejan Bosanac
>>
>>
>> http://www.ttmsolutions.com - get a free ActiveMQ user guide
>>
>> ActiveMQ in Action - http://www.manning.com/snyder/
>> Scripting in Java - http://www.scriptinginjava.net
>>
>>
>>
>> � wrote:
>> > I realized that by default the db used is latin. Would this help if i
>> set
>> > the db which received the values (we use jdbc persistency)
>> > to utf8 instead of latin?
>> >
>> > On Wed, Oct 29, 2008 at 10:23 AM, Lars Eirik Rønning <
>> larseirik@gmail.com>wrote:
>> >
>> >
>> >> Well actually i would just like to take the xml which comes in and have
>> >> this posted by my consumer.
>> >>
>> >> String myxml = request.getParameter("inputxml");
>> >> sender.sendMessage(myxml);
>> >>
>> >> sender is a regular producer which uses the sendTextMessage method
>> defined
>> >> by the jms spec.
>> >> Do i really need to do anything to this string if i just want to ship
>> it to
>> >> the que?
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> On Wed, Oct 29, 2008 at 9:54 AM, Dejan Bosanac <
>> >> dejan.bosanac@ttmsolutions.com> wrote:
>> >>
>> >>
>> >>> Hi,
>> >>>
>> >>> can you post your code that creates and sends a message?
>> >>>
>> >>> Regards
>> >>>
>> >>> --
>> >>> Dejan Bosanac
>> >>>
>> >>>
>> >>> http://www.ttmsolutions.com - get a free ActiveMQ user guide
>> >>>
>> >>> ActiveMQ in Action - http://www.manning.com/snyder/
>> >>> Scripting in Java - http://www.scriptinginjava.net
>> >>>
>> >>>
>> >>>
>> >>> � wrote:
>> >>>
>> >>>> Hi.
>> >>>> I have a servlet which receives a post containing a utf8 encoded
>> string.
>> >>>> When this string is pushed to the que it seems to be stored as
>> another
>> >>>> characterset. When i use jaxb to autoprocess the xml from the que, i
>> get
>> >>>>
>> >>> an
>> >>>
>> >>>> exception relating to byte offset.
>> >>>> So far what i have done is used an outputstreamwriter and reencoded
>> the
>> >>>> string with utf8. This semmes to work.. However this is not what we
>> >>>>
>> >>> want.
>> >>>
>> >>>> When the servlet or in production the php client sends something to
>> the
>> >>>>
>> >>> que
>> >>>
>> >>>> , the que is not respecting the utf8 encoding either.
>> >>>> The orignal message is sendt from flex (which always uses utf8).
>> >>>>
>> >>>> Any easy fix for this? We would like to remoe the intermediate step
>> >>>>
>> >>> where we
>> >>>
>> >>>> now have to reencode the string.. Is this a common problem?
>> >>>>
>> >>>>
>> >>>>
>> >>>
>> >>>
>>
>>
>>
>

Re: Utf8 encoding with activemq 5.1

Posted by Lars Eirik Rønning <la...@gmail.com>.
we tried this but received an error when settin the character set to utf-8The
table ACTIVEMQ_ACKS failed.

Any idea?

On Wed, Oct 29, 2008 at 11:24 AM, Dejan Bosanac <
dejan.bosanac@ttmsolutions.com> wrote:

> Can you please try and let us know
>
> Cheers
>
> --
> Dejan Bosanac
>
>
> http://www.ttmsolutions.com - get a free ActiveMQ user guide
>
> ActiveMQ in Action - http://www.manning.com/snyder/
> Scripting in Java - http://www.scriptinginjava.net
>
>
>
> � wrote:
> > I realized that by default the db used is latin. Would this help if i set
> > the db which received the values (we use jdbc persistency)
> > to utf8 instead of latin?
> >
> > On Wed, Oct 29, 2008 at 10:23 AM, Lars Eirik Rønning <
> larseirik@gmail.com>wrote:
> >
> >
> >> Well actually i would just like to take the xml which comes in and have
> >> this posted by my consumer.
> >>
> >> String myxml = request.getParameter("inputxml");
> >> sender.sendMessage(myxml);
> >>
> >> sender is a regular producer which uses the sendTextMessage method
> defined
> >> by the jms spec.
> >> Do i really need to do anything to this string if i just want to ship it
> to
> >> the que?
> >>
> >>
> >>
> >>
> >>
> >> On Wed, Oct 29, 2008 at 9:54 AM, Dejan Bosanac <
> >> dejan.bosanac@ttmsolutions.com> wrote:
> >>
> >>
> >>> Hi,
> >>>
> >>> can you post your code that creates and sends a message?
> >>>
> >>> Regards
> >>>
> >>> --
> >>> Dejan Bosanac
> >>>
> >>>
> >>> http://www.ttmsolutions.com - get a free ActiveMQ user guide
> >>>
> >>> ActiveMQ in Action - http://www.manning.com/snyder/
> >>> Scripting in Java - http://www.scriptinginjava.net
> >>>
> >>>
> >>>
> >>> � wrote:
> >>>
> >>>> Hi.
> >>>> I have a servlet which receives a post containing a utf8 encoded
> string.
> >>>> When this string is pushed to the que it seems to be stored as another
> >>>> characterset. When i use jaxb to autoprocess the xml from the que, i
> get
> >>>>
> >>> an
> >>>
> >>>> exception relating to byte offset.
> >>>> So far what i have done is used an outputstreamwriter and reencoded
> the
> >>>> string with utf8. This semmes to work.. However this is not what we
> >>>>
> >>> want.
> >>>
> >>>> When the servlet or in production the php client sends something to
> the
> >>>>
> >>> que
> >>>
> >>>> , the que is not respecting the utf8 encoding either.
> >>>> The orignal message is sendt from flex (which always uses utf8).
> >>>>
> >>>> Any easy fix for this? We would like to remoe the intermediate step
> >>>>
> >>> where we
> >>>
> >>>> now have to reencode the string.. Is this a common problem?
> >>>>
> >>>>
> >>>>
> >>>
> >>>
>
>
>

Re: Utf8 encoding with activemq 5.1

Posted by Dejan Bosanac <de...@ttmsolutions.com>.
Can you please try and let us know

Cheers

-- 
Dejan Bosanac


http://www.ttmsolutions.com - get a free ActiveMQ user guide

ActiveMQ in Action - http://www.manning.com/snyder/
Scripting in Java - http://www.scriptinginjava.net



� wrote:
> I realized that by default the db used is latin. Would this help if i set
> the db which received the values (we use jdbc persistency)
> to utf8 instead of latin?
>
> On Wed, Oct 29, 2008 at 10:23 AM, Lars Eirik Rønning <la...@gmail.com>wrote:
>
>   
>> Well actually i would just like to take the xml which comes in and have
>> this posted by my consumer.
>>
>> String myxml = request.getParameter("inputxml");
>> sender.sendMessage(myxml);
>>
>> sender is a regular producer which uses the sendTextMessage method defined
>> by the jms spec.
>> Do i really need to do anything to this string if i just want to ship it to
>> the que?
>>
>>
>>
>>
>>
>> On Wed, Oct 29, 2008 at 9:54 AM, Dejan Bosanac <
>> dejan.bosanac@ttmsolutions.com> wrote:
>>
>>     
>>> Hi,
>>>
>>> can you post your code that creates and sends a message?
>>>
>>> Regards
>>>
>>> --
>>> Dejan Bosanac
>>>
>>>
>>> http://www.ttmsolutions.com - get a free ActiveMQ user guide
>>>
>>> ActiveMQ in Action - http://www.manning.com/snyder/
>>> Scripting in Java - http://www.scriptinginjava.net
>>>
>>>
>>>
>>> � wrote:
>>>       
>>>> Hi.
>>>> I have a servlet which receives a post containing a utf8 encoded string.
>>>> When this string is pushed to the que it seems to be stored as another
>>>> characterset. When i use jaxb to autoprocess the xml from the que, i get
>>>>         
>>> an
>>>       
>>>> exception relating to byte offset.
>>>> So far what i have done is used an outputstreamwriter and reencoded the
>>>> string with utf8. This semmes to work.. However this is not what we
>>>>         
>>> want.
>>>       
>>>> When the servlet or in production the php client sends something to the
>>>>         
>>> que
>>>       
>>>> , the que is not respecting the utf8 encoding either.
>>>> The orignal message is sendt from flex (which always uses utf8).
>>>>
>>>> Any easy fix for this? We would like to remoe the intermediate step
>>>>         
>>> where we
>>>       
>>>> now have to reencode the string.. Is this a common problem?
>>>>
>>>>
>>>>         
>>>
>>>       



Re: Utf8 encoding with activemq 5.1

Posted by Lars Eirik Rønning <la...@gmail.com>.
I realized that by default the db used is latin. Would this help if i set
the db which received the values (we use jdbc persistency)
to utf8 instead of latin?

On Wed, Oct 29, 2008 at 10:23 AM, Lars Eirik Rønning <la...@gmail.com>wrote:

> Well actually i would just like to take the xml which comes in and have
> this posted by my consumer.
>
> String myxml = request.getParameter("inputxml");
> sender.sendMessage(myxml);
>
> sender is a regular producer which uses the sendTextMessage method defined
> by the jms spec.
> Do i really need to do anything to this string if i just want to ship it to
> the que?
>
>
>
>
>
> On Wed, Oct 29, 2008 at 9:54 AM, Dejan Bosanac <
> dejan.bosanac@ttmsolutions.com> wrote:
>
>> Hi,
>>
>> can you post your code that creates and sends a message?
>>
>> Regards
>>
>> --
>> Dejan Bosanac
>>
>>
>> http://www.ttmsolutions.com - get a free ActiveMQ user guide
>>
>> ActiveMQ in Action - http://www.manning.com/snyder/
>> Scripting in Java - http://www.scriptinginjava.net
>>
>>
>>
>> � wrote:
>> > Hi.
>> > I have a servlet which receives a post containing a utf8 encoded string.
>> > When this string is pushed to the que it seems to be stored as another
>> > characterset. When i use jaxb to autoprocess the xml from the que, i get
>> an
>> > exception relating to byte offset.
>> > So far what i have done is used an outputstreamwriter and reencoded the
>> > string with utf8. This semmes to work.. However this is not what we
>> want.
>> >
>> > When the servlet or in production the php client sends something to the
>> que
>> > , the que is not respecting the utf8 encoding either.
>> > The orignal message is sendt from flex (which always uses utf8).
>> >
>> > Any easy fix for this? We would like to remoe the intermediate step
>> where we
>> > now have to reencode the string.. Is this a common problem?
>> >
>> >
>>
>>
>>
>

Re: Utf8 encoding with activemq 5.1

Posted by Lars Eirik Rønning <la...@gmail.com>.
Well actually i would just like to take the xml which comes in and have this
posted by my consumer.

String myxml = request.getParameter("inputxml");
sender.sendMessage(myxml);

sender is a regular producer which uses the sendTextMessage method defined
by the jms spec.
Do i really need to do anything to this string if i just want to ship it to
the que?




On Wed, Oct 29, 2008 at 9:54 AM, Dejan Bosanac <
dejan.bosanac@ttmsolutions.com> wrote:

> Hi,
>
> can you post your code that creates and sends a message?
>
> Regards
>
> --
> Dejan Bosanac
>
>
> http://www.ttmsolutions.com - get a free ActiveMQ user guide
>
> ActiveMQ in Action - http://www.manning.com/snyder/
> Scripting in Java - http://www.scriptinginjava.net
>
>
>
> � wrote:
> > Hi.
> > I have a servlet which receives a post containing a utf8 encoded string.
> > When this string is pushed to the que it seems to be stored as another
> > characterset. When i use jaxb to autoprocess the xml from the que, i get
> an
> > exception relating to byte offset.
> > So far what i have done is used an outputstreamwriter and reencoded the
> > string with utf8. This semmes to work.. However this is not what we want.
> >
> > When the servlet or in production the php client sends something to the
> que
> > , the que is not respecting the utf8 encoding either.
> > The orignal message is sendt from flex (which always uses utf8).
> >
> > Any easy fix for this? We would like to remoe the intermediate step where
> we
> > now have to reencode the string.. Is this a common problem?
> >
> >
>
>
>

Re: Utf8 encoding with activemq 5.1

Posted by Dejan Bosanac <de...@ttmsolutions.com>.
Hi,

can you post your code that creates and sends a message?

Regards

-- 
Dejan Bosanac


http://www.ttmsolutions.com - get a free ActiveMQ user guide

ActiveMQ in Action - http://www.manning.com/snyder/
Scripting in Java - http://www.scriptinginjava.net



� wrote:
> Hi.
> I have a servlet which receives a post containing a utf8 encoded string.
> When this string is pushed to the que it seems to be stored as another
> characterset. When i use jaxb to autoprocess the xml from the que, i get an
> exception relating to byte offset.
> So far what i have done is used an outputstreamwriter and reencoded the
> string with utf8. This semmes to work.. However this is not what we want.
>
> When the servlet or in production the php client sends something to the que
> , the que is not respecting the utf8 encoding either.
> The orignal message is sendt from flex (which always uses utf8).
>
> Any easy fix for this? We would like to remoe the intermediate step where we
> now have to reencode the string.. Is this a common problem?
>
>