[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlrpc-user
Subject:    Re: [Axiom] Issue when creating OMTextImpl object setting NodeType to 4 (TextNode) when requests con
From:       Andreas Veithen <andreas.veithen () gmail ! com>
Date:       2016-05-18 21:48:57
Message-ID: CADx4_uXtWGhVKL6SgHmT28mpbB1EVuPWJa-Ywpn9yjBzSA+RdA () mail ! gmail ! com
[Download RAW message or body]

On May 18, 2016 4:58 AM, "Vijitha Ekanayake" <ekvijitha@gmail.com> wrote:
> 
> I'm trying to create textNode passing plain text content to axiom 1.2.11.
I was able to successfully create textNode when the text doesn't contains
any special characters(Please check attached file). However It fails when
It tries to construct  TextNode type OMTextImpl[1] object with the text
with special characters as in the attache file, It throws a runtime
exception. This runtime exception is thrown in toString(...) method of
OMElementImpl class while trying to serialize the content.
AFAIU OMElementImpl class internally uses BaseStreamWriter class which
resides in the woodstox to stream the message content, when writing the
special character, the value of that character seems not identified as
valid one, So that it throws  IOException[2] with the stackrace[3]
and OMElementImpl class throws it as runtime exception in its toString(...)
method[4]. Any help to get rid of this issue is highly appreciated.

The way to get rid of this issue is not to create OMText nodes with invalid
characters.

> 
> 
> [1].
http://svn.apache.org/viewvc/webservices/axiom/tags/1.2.11/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java?view=markup#l134

> [2].
https://github.com/FasterXML/woodstox/blob/master/src/main/java/com/ctc/wstx/api/InvalidCharHandler.java#L54

> [3].
> at
com.ctc.wstx.api.InvalidCharHandler$FailingHandler.convertInvalidChar(InvalidCharHandler.java:55)

> at com.ctc.wstx.sw.XmlWriter.handleInvalidChar(XmlWriter.java:623)
> at
com.ctc.wstx.sw.BufferingXmlWriter.writeCharacters(BufferingXmlWriter.java:554)
> at
com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.java:460)
> at
org.apache.axiom.om.impl.MTOMXMLStreamWriter.writeCharacters(MTOMXMLStreamWriter.java:289)

> at
org.apache.axiom.om.impl.llom.OMTextImpl.writeOutput(OMTextImpl.java:250)
> at
org.apache.axiom.om.impl.llom.OMTextImpl.internalSerialize(OMTextImpl.java:415)
> at
org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:555)

> at
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:875)
> at
org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(OMSourcedElementImpl.java:682)

> at
org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:555)

> at
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:875)
> at
org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:230)

> at
org.apache.axiom.om.impl.llom.OMSerializableImpl.serialize(OMSerializableImpl.java:125)

> at
org.apache.axiom.om.impl.llom.OMSerializableImpl.serialize(OMSerializableImpl.java:113)

> at
org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:988)
> at java.lang.String.valueOf(String.java:2849)
> at java.lang.StringBuffer.append(StringBuffer.java:232)
> 
> [4].
https://github.com/wso2-support/wso2-axiom/blob/support-1.2.11-wso2v6/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java#L983

> 
> Thanks.
> 
> 
> --
> Best Regards,
> 
> Vijitha Ekanayake
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: dev-help@ws.apache.org


[Attachment #3 (text/html)]

<p dir="ltr"><br>
On May 18, 2016 4:58 AM, &quot;Vijitha Ekanayake&quot; &lt;<a \
href="mailto:ekvijitha@gmail.com">ekvijitha@gmail.com</a>&gt; wrote:<br> &gt;<br>
&gt; I'm trying to create textNode passing plain text content to axiom 1.2.11. I was \
able to successfully create textNode when the text doesn't contains any special \
characters(Please check attached file).  However It fails when It tries to construct  \
TextNode type OMTextImpl[1] object with the text with special characters as in the \
attache file, It throws a runtime exception.  This runtime exception is thrown in \
toString(...) method of OMElementImpl class while trying to  serialize  the content. \
AFAIU  OMElementImpl  class internally uses  BaseStreamWriter class which resides in \
the woodstox to stream the message content, when writing the special character, the \
value of that character seems not identified as valid one, So that it throws   \
IOException[2] with the stackrace[3] and  OMElementImpl class throws it as runtime \
exception in its toString(...) method[4].  Any help to get rid of this issue is \
highly appreciated.</p> <p dir="ltr">The way to get rid of this issue is not to \
create OMText nodes with invalid characters.</p> <p dir="ltr">&gt;<br>
&gt;<br>
&gt; [1].  <a href="http://svn.apache.org/viewvc/webservices/axiom/tags/1.2.11/modules \
/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java?view=markup#l1 \
34">http://svn.apache.org/viewvc/webservices/axiom/tags/1.2.11/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java?view=markup#l134</a><br>
 &gt; [2].  <a href="https://github.com/FasterXML/woodstox/blob/master/src/main/java/c \
om/ctc/wstx/api/InvalidCharHandler.java#L54">https://github.com/FasterXML/woodstox/blob/master/src/main/java/com/ctc/wstx/api/InvalidCharHandler.java#L54</a><br>
 &gt; [3].  <br>
&gt;   at com.ctc.wstx.api.InvalidCharHandler$FailingHandler.convertInvalidChar(InvalidCharHandler.java:55)<br>
 &gt;     at com.ctc.wstx.sw.XmlWriter.handleInvalidChar(XmlWriter.java:623)<br>
&gt;     at com.ctc.wstx.sw.BufferingXmlWriter.writeCharacters(BufferingXmlWriter.java:554)<br>
 &gt;     at com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.java:460)<br>
 &gt;     at org.apache.axiom.om.impl.MTOMXMLStreamWriter.writeCharacters(MTOMXMLStreamWriter.java:289)<br>
 &gt;     at org.apache.axiom.om.impl.llom.OMTextImpl.writeOutput(OMTextImpl.java:250)<br>
 &gt;     at org.apache.axiom.om.impl.llom.OMTextImpl.internalSerialize(OMTextImpl.java:415)<br>
 &gt;     at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:555)<br>
 &gt;     at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:875)<br>
 &gt;     at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(OMSourcedElementImpl.java:682)<br>
 &gt;     at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:555)<br>
 &gt;     at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:875)<br>
 &gt;     at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:230)<br>
 &gt;     at org.apache.axiom.om.impl.llom.OMSerializableImpl.serialize(OMSerializableImpl.java:125)<br>
 &gt;     at org.apache.axiom.om.impl.llom.OMSerializableImpl.serialize(OMSerializableImpl.java:113)<br>
 &gt;     at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:988)<br>
 &gt;     at java.lang.String.valueOf(String.java:2849)<br>
&gt;     at java.lang.StringBuffer.append(StringBuffer.java:232)<br>
&gt;<br>
&gt; [4].  <a href="https://github.com/wso2-support/wso2-axiom/blob/support-1.2.11-wso \
2v6/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java# \
L983">https://github.com/wso2-support/wso2-axiom/blob/support-1.2.11-wso2v6/modules/ax \
iom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java#L983</a><br> \
&gt;<br> &gt; Thanks.<br>
&gt;<br>
&gt;<br>
&gt; -- <br>
&gt; Best Regards,<br>
&gt;<br>
&gt; Vijitha Ekanayake<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; ---------------------------------------------------------------------<br>
&gt; To unsubscribe, e-mail: <a \
href="mailto:dev-unsubscribe@ws.apache.org">dev-unsubscribe@ws.apache.org</a><br> \
&gt; For additional commands, e-mail: <a \
href="mailto:dev-help@ws.apache.org">dev-help@ws.apache.org</a><br> </p>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic