You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Yuqi Zhang <zh...@gmail.com> on 2018/09/05 13:50:36 UTC

CAS and Serialization on Emoji codes

Dear UIMA experts,

I need process a String including an emoji 😊(
https://www.iemoji.com/view/emoji/2/smileys-people/smiling-face-with-smiling-eyes
).
I put the string "This is a 😊" in a CAS, and sendCAS(cas) to a remote
server.
But it failed at addMessage(msg) at line 971 in class
BaseUIMAAsynchronousEngineCommon_impl with the error message:

javax.jms.JMSException: Failed to build body from content. Serializable
class not available to broker. Reason: java.lang.ClassNotFoundException:
Forbidden class org.xml.sax.SAXParseException! This class is not trusted to
be serialized as ObjectMessage payload.


When I check the serialization result of the cas in the msg, I see the 😊
is encoded as "&#55357;&#56842;".
Is that the reason this CAS sent failed?
Because this emoji 😊 can be processed without any problem in my another
codes where calls the sendAndReceiveCAS(). The serialization result there
is "&#128522;".
How does it happen?
Besides the sofa content, is there any other factors to affect the
serialization result?

I am a newer to UIMA. And I have read the UIMA references about the
serialization and cas sections. But still have no idea how I could make 😊
surely serialized into "&#128522;"

Many thanks for any feedback!
Best regards,
Yuqi Zhang

Re: CAS and Serialization on Emoji codes

Posted by Marshall Schor <ms...@schor.com>.
I started a thread for this on the users list - please continue there.

-Marshall


On 9/5/2018 9:50 AM, Yuqi Zhang wrote:
> Dear UIMA experts,
>
> I need process a String including an emoji 😊(
> https://www.iemoji.com/view/emoji/2/smileys-people/smiling-face-with-smiling-eyes
> ).
> I put the string "This is a 😊" in a CAS, and sendCAS(cas) to a remote
> server.
> But it failed at addMessage(msg) at line 971 in class
> BaseUIMAAsynchronousEngineCommon_impl with the error message:
>
> javax.jms.JMSException: Failed to build body from content. Serializable
> class not available to broker. Reason: java.lang.ClassNotFoundException:
> Forbidden class org.xml.sax.SAXParseException! This class is not trusted to
> be serialized as ObjectMessage payload.
>
>
> When I check the serialization result of the cas in the msg, I see the 😊
> is encoded as "&#55357;&#56842;".
> Is that the reason this CAS sent failed?
> Because this emoji 😊 can be processed without any problem in my another
> codes where calls the sendAndReceiveCAS(). The serialization result there
> is "&#128522;".
> How does it happen?
> Besides the sofa content, is there any other factors to affect the
> serialization result?
>
> I am a newer to UIMA. And I have read the UIMA references about the
> serialization and cas sections. But still have no idea how I could make 😊
> surely serialized into "&#128522;"
>
> Many thanks for any feedback!
> Best regards,
> Yuqi Zhang
>


Re: CAS and Serialization on Emoji codes

Posted by Luca Toldo <lu...@gmail.com>.
Dear , that is the appropriate Unicode value for the emoticon . http://www.codetable.net/decimal/128522 

Therefore it is generated by the Unicode conversion.

> Am 05.09.2018 um 23:49 schrieb Marshall Schor <ms...@schor.com>:
> 
> Hi, could you post a stack trace of the failure, so we could see the path
> between the JMSException and the call to addMessage(msg).
> 
> -Marshall
> 
> 
>> On 9/5/2018 9:50 AM, Yuqi Zhang wrote:
>> Dear UIMA experts,
>> 
>> I need process a String including an emoji 😊(
>> https://www.iemoji.com/view/emoji/2/smileys-people/smiling-face-with-smiling-eyes
>> ).
>> I put the string "This is a 😊" in a CAS, and sendCAS(cas) to a remote
>> server.
>> But it failed at addMessage(msg) at line 971 in class
>> BaseUIMAAsynchronousEngineCommon_impl with the error message:
>> 
>> javax.jms.JMSException: Failed to build body from content. Serializable
>> class not available to broker. Reason: java.lang.ClassNotFoundException:
>> Forbidden class org.xml.sax.SAXParseException! This class is not trusted to
>> be serialized as ObjectMessage payload.
>> 
>> 
>> When I check the serialization result of the cas in the msg, I see the 😊
>> is encoded as "&#55357;&#56842;".
>> Is that the reason this CAS sent failed?
>> Because this emoji 😊 can be processed without any problem in my another
>> codes where calls the sendAndReceiveCAS(). The serialization result there
>> is "&#128522;".
>> How does it happen?
>> Besides the sofa content, is there any other factors to affect the
>> serialization result?
>> 
>> I am a newer to UIMA. And I have read the UIMA references about the
>> serialization and cas sections. But still have no idea how I could make 😊
>> surely serialized into "&#128522;"
>> 
>> Many thanks for any feedback!
>> Best regards,
>> Yuqi Zhang
>> 
> 

Re: CAS and Serialization on Emoji codes

Posted by Marshall Schor <ms...@schor.com>.
Hi, could you post a stack trace of the failure, so we could see the path
between the JMSException and the call to addMessage(msg).

-Marshall


On 9/5/2018 9:50 AM, Yuqi Zhang wrote:
> Dear UIMA experts,
>
> I need process a String including an emoji 😊(
> https://www.iemoji.com/view/emoji/2/smileys-people/smiling-face-with-smiling-eyes
> ).
> I put the string "This is a 😊" in a CAS, and sendCAS(cas) to a remote
> server.
> But it failed at addMessage(msg) at line 971 in class
> BaseUIMAAsynchronousEngineCommon_impl with the error message:
>
> javax.jms.JMSException: Failed to build body from content. Serializable
> class not available to broker. Reason: java.lang.ClassNotFoundException:
> Forbidden class org.xml.sax.SAXParseException! This class is not trusted to
> be serialized as ObjectMessage payload.
>
>
> When I check the serialization result of the cas in the msg, I see the 😊
> is encoded as "&#55357;&#56842;".
> Is that the reason this CAS sent failed?
> Because this emoji 😊 can be processed without any problem in my another
> codes where calls the sendAndReceiveCAS(). The serialization result there
> is "&#128522;".
> How does it happen?
> Besides the sofa content, is there any other factors to affect the
> serialization result?
>
> I am a newer to UIMA. And I have read the UIMA references about the
> serialization and cas sections. But still have no idea how I could make 😊
> surely serialized into "&#128522;"
>
> Many thanks for any feedback!
> Best regards,
> Yuqi Zhang
>


Re: CAS and Serialization on Emoji codes

Posted by Jaroslaw Cwiklik <cw...@apache.org>.
What version of uima-as are you using? If not the latest (2.10.3) please
download it from https://uima.apache.org/downloads.cgi
and try your test.

If you are running with the latest uima-as and an exception you described
before is thrown, what happens if you remove emoji character from the CAS?
Is the exception you are experiencing related to the emoji or something
else?

Jerry


On Fri, Sep 7, 2018 at 5:20 PM Marshall Schor <ms...@schor.com> wrote:

> This sounds like a configuration issue around JMS messaging.  An internet
> search
> turned up this, which might have an idea for the solution:
>
>
> https://stackoverflow.com/questions/36619432/springboot-activemq-how-to-set-trusted-packages
>
> -Marshall Schor
>
>
> On 9/5/2018 9:50 AM, Yuqi Zhang wrote:
> > Dear UIMA experts,
> >
> > I need process a String including an emoji 😊(
> >
> https://www.iemoji.com/view/emoji/2/smileys-people/smiling-face-with-smiling-eyes
> > ).
> > I put the string "This is a 😊" in a CAS, and sendCAS(cas) to a remote
> > server.
> > But it failed at addMessage(msg) at line 971 in class
> > BaseUIMAAsynchronousEngineCommon_impl with the error message:
> >
> > javax.jms.JMSException: Failed to build body from content. Serializable
> > class not available to broker. Reason: java.lang.ClassNotFoundException:
> > Forbidden class org.xml.sax.SAXParseException! This class is not trusted
> to
> > be serialized as ObjectMessage payload.
> >
> >
> > When I check the serialization result of the cas in the msg, I see the 😊
> > is encoded as "&#55357;&#56842;".
> > Is that the reason this CAS sent failed?
> > Because this emoji 😊 can be processed without any problem in my another
> > codes where calls the sendAndReceiveCAS(). The serialization result there
> > is "&#128522;".
> > How does it happen?
> > Besides the sofa content, is there any other factors to affect the
> > serialization result?
> >
> > I am a newer to UIMA. And I have read the UIMA references about the
> > serialization and cas sections. But still have no idea how I could make
> 😊
> > surely serialized into "&#128522;"
> >
> > Many thanks for any feedback!
> > Best regards,
> > Yuqi Zhang
> >
>
>

Re: CAS and Serialization on Emoji codes

Posted by Marshall Schor <ms...@schor.com>.
This sounds like a configuration issue around JMS messaging.  An internet search
turned up this, which might have an idea for the solution:

https://stackoverflow.com/questions/36619432/springboot-activemq-how-to-set-trusted-packages

-Marshall Schor


On 9/5/2018 9:50 AM, Yuqi Zhang wrote:
> Dear UIMA experts,
>
> I need process a String including an emoji 😊(
> https://www.iemoji.com/view/emoji/2/smileys-people/smiling-face-with-smiling-eyes
> ).
> I put the string "This is a 😊" in a CAS, and sendCAS(cas) to a remote
> server.
> But it failed at addMessage(msg) at line 971 in class
> BaseUIMAAsynchronousEngineCommon_impl with the error message:
>
> javax.jms.JMSException: Failed to build body from content. Serializable
> class not available to broker. Reason: java.lang.ClassNotFoundException:
> Forbidden class org.xml.sax.SAXParseException! This class is not trusted to
> be serialized as ObjectMessage payload.
>
>
> When I check the serialization result of the cas in the msg, I see the 😊
> is encoded as "&#55357;&#56842;".
> Is that the reason this CAS sent failed?
> Because this emoji 😊 can be processed without any problem in my another
> codes where calls the sendAndReceiveCAS(). The serialization result there
> is "&#128522;".
> How does it happen?
> Besides the sofa content, is there any other factors to affect the
> serialization result?
>
> I am a newer to UIMA. And I have read the UIMA references about the
> serialization and cas sections. But still have no idea how I could make 😊
> surely serialized into "&#128522;"
>
> Many thanks for any feedback!
> Best regards,
> Yuqi Zhang
>