Hi,
I just updated from subversion and the SAAJ Integration test seems to be
failing:
[junit] Running org.apache.axis2.saaj.integration.IntegrationTest
[junit] Tests run: 3, Failures: 0, Errors: 3, Time elapsed: 9.717
sec
[junit] [ERROR] TEST
org.apache.axis2.saaj.integration.IntegrationTest FAILED
one of the failures is as follows:
<testcase name="testSendReceiveMessageWithAttachment" time="3.094">
<error message="java.lang.UnsupportedOperationException"
type="org.apache.axiom.om.OMException">org.apache.axiom.om.OMException:
java.lang.UnsupportedOperationException
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next
(StAXOMBuilder.java:280)
at org.apache.axiom.om.impl.llom.OMElementImpl.getNextOMSibling
(OMElementImpl.java:263)
at org.apache.axiom.om.impl.traverse.OMChildrenIterator.next
(OMChildrenIterator.java:111)
at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize
(OMElementImpl.java:766)
at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize
(SOAPEnvelopeImpl.java:163)
at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize
(OMElementImpl.java:751)
at org.apache.axiom.om.impl.llom.OMNodeImpl.serialize
(OMNodeImpl.java:306)
at org.apache.axiom.om.impl.llom.OMNodeImpl.serialize
(OMNodeImpl.java:347)
at org.apache.axiom.om.impl.llom.OMElementImpl.toString
(OMElementImpl.java:894)
at java.lang.String.valueOf(String.java:2131)
at java.lang.StringBuffer.append(StringBuffer.java:370)
at org.apache.axis2.saaj.SOAPConnectionImpl.toOMSOAPEnvelope
(SOAPConnectionImpl.java:293)
at org.apache.axis2.saaj.SOAPConnectionImpl.handleSOAPMessage
(SOAPConnectionImpl.java:147)
at org.apache.axis2.saaj.SOAPConnectionImpl.call
(SOAPConnectionImpl.java:116)
at
org.apache.axis2.saaj.integration.IntegrationTest.testSendReceiveMessageWithAttachment(IntegrationTest.java:127)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
Caused by: java.lang.UnsupportedOperationException
at org.apache.axiom.om.impl.dom.DOMStAXWrapper.getProperty
(DOMStAXWrapper.java:880)
at org.apache.axiom.om.impl.builder.StAXBuilder.createOMText
(StAXBuilder.java:190)
at org.apache.axiom.om.impl.builder.StAXBuilder.createOMText
(StAXBuilder.java:168)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next
(StAXOMBuilder.java:222)
... 28 more
</error>
</testcase>
As the stack trace says,
org.apache.axiom.om.impl.dom.DOMStAXWrapper.getProperty throws an
UnsupportedOperationException (always). I'm guessing that these errors
may have arisen due to this change:
/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/builder/StAXBuilder.java
Revision 391323 - (view) (download) (as text) - [select for diffs]
Modified Tue Apr 4 14:39:20 2006 UTC (3 hours, 22 minutes ago) by
chinthaka
File length: 13046 byte(s)
Diff to previous 391204 (colored)
- problem: when serializing into a text node, we lose the fact that sometimes
the text node's content is binary characters
==> hence, right now, to be safe we always serialize as base64
- solution for ADB (which may be used by others):
- if the text content being generated is infact of binary nature (i.e., a
DataHandler), then when a CHARACTERS event is generated
by the ADB pull parser, the parser's getProperty() method will return true for
"are you binary?"
- if the value of that property is true, then parser.getProperty() for the
"data handler" property will return a data handler
which can be used to access the binary data
- we also change StaXOMBuilder to check this property and create the TextNode
appropriately
This commit will only change StAXOMBuilder and hopefully Ajith will change ADB
for this.
(This commit has a small catch as getProperty method of XMLStreamReader will
return IllegalArgumentException, which is a
RuntimeException if the property is not found. So I had to catch this and
create OMText within the catch statement. )
-Bill