You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Jim Peterson <ji...@issinc.com> on 2006/05/26 01:09:45 UTC

XMLStreamException when streaming large data set returns from the server using OMDataSource

PROBLEM:  When an extremely large data set (i.e. 72 Mb of XML) is attempted
to be serialized and sent from the server using the OMSourcedElementImpl
with an OMDataSource, the XML streaming stops fairly early on with a
XMLStreamException shown below (note that the stack trace can only be seen
if you modify the StreamingOMSerializer to print it out):

 

17:03:03,562 INFO  [STDOUT] javax.xml.stream.XMLStreamException

17:03:03,562 INFO  [STDOUT]     at
com.ctc.wstx.sw.BaseNsStreamWriter.doWriteStartTag(BaseNsStreamWr

iter.java:495)

17:03:03,562 INFO  [STDOUT]     at
com.ctc.wstx.sw.SimpleNsStreamWriter.writeStartOrEmpty(SimpleNsSt

reamWriter.java:247)

17:03:03,562 INFO  [STDOUT]     at
com.ctc.wstx.sw.BaseNsStreamWriter.writeStartElement(BaseNsStream

Writer.java:273)

17:03:03,562 INFO  [STDOUT]     at
org.apache.axiom.om.impl.MTOMXMLStreamWriter.writeStartElement(MT

OMXMLStreamWriter.java:87)

17:03:03,578 INFO  [STDOUT]     at
org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serializ

eElement(StreamingOMSerializer.java:129)

17:03:03,578 INFO  [STDOUT]     at
org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serializ

eNode(StreamingOMSerializer.java:79)

17:03:03,578 INFO  [STDOUT]     at
org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serializ

e(StreamingOMSerializer.java:60)

17:03:03,578 INFO  [STDOUT]     at
org.apache.axiom.om.impl.util.OMSerializerUtil.serializeByPullStr

eam(OMSerializerUtil.java:315)

17:03:03,578 INFO  [STDOUT]     at
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OME

lementImpl.java:786)

17:03:03,593 INFO  [STDOUT]     at
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndC

onsume(OMElementImpl.java:809)

17:03:03,593 INFO  [STDOUT]     at
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OME

lementImpl.java:780)

17:03:03,593 INFO  [STDOUT]     at
org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerializ

e(SOAPEnvelopeImpl.java:171)

17:03:03,593 INFO  [STDOUT]     at
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndC

onsume(OMElementImpl.java:809)

17:03:03,609 INFO  [STDOUT]     at
org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNo

deImpl.java:381)

17:03:03,609 INFO  [STDOUT]     at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUs

ingOutputStream(CommonsHTTPTransportSender.java:256)

17:03:03,609 INFO  [STDOUT]     at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke

(CommonsHTTPTransportSender.java:210)

17:03:03,609 INFO  [STDOUT]     at
org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:589)

 

 

CORRECTION:  In the server axis2.xml file, set the enableMTOM parameter to
true.  This allows the entire data set to be serialized to the client.
Server memory spikes, but comes back down.

 

Why does MTOM have to enable on the server to make this work?  Is there a
way to make large data set returns work without using MTOM?  We would rather
not use MTOM in our server responses.

 

RELATED PROBLEM:  Even with MTOM set on the server side and client side
memory set to a high level, the client throws the following Read timed out
exception when trying to receive the large data set return:

 

org.apache.axis2.AxisFault: Read timed out; nested exception is: 

      java.net.SocketTimeoutException: Read timed out; nested exception is: 

      org.apache.axis2.AxisFault: Read timed out; nested exception is: 

      java.net.SocketTimeoutException: Read timed out

      at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTT
PTransportSender.java:223)

      at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:589)

      at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperatio
n.java:328)

      at
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOpera
tion.java:279)

      at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:457)

      at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:399)

      at
ipt.tas.gateway.service.data_maint.DataMaintenanceServiceTest.testLoadedQuer
y(DataMaintenanceServiceTest.java:474)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)

      at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)

      at java.lang.reflect.Method.invoke(Method.java:585)

      at junit.framework.TestCase.runTest(TestCase.java:154)

      at junit.framework.TestCase.runBare(TestCase.java:127)

      at junit.framework.TestResult$1.protect(TestResult.java:106)

      at junit.framework.TestResult.runProtected(TestResult.java:124)

      at junit.framework.TestResult.run(TestResult.java:109)

      at junit.framework.TestCase.run(TestCase.java:118)

      at junit.framework.TestSuite.runTest(TestSuite.java:208)

      at junit.framework.TestSuite.run(TestSuite.java:203)

      at junit.textui.TestRunner.doRun(TestRunner.java:116)

      at
com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:57
)

      at junit.textui.TestRunner.start(TestRunner.java:172)

      at
com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTest
Runner2.java:23)

      at
com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitSt
arter.java:97)

      at
com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31)

 

Thanks,

Jim

 


Re: XMLStreamException when streaming large data set returns from the server using OMDataSource

Posted by Davanum Srinivas <da...@gmail.com>.
For #1, please log a JIRA bug.

For #2, please set the timeout options

options.setProperty(org.apache.axis2.transport.http.HTTPConstants.SO_TIMEOUT,new
Integer(480000));
options.setProperty(org.apache.axis2.transport.http.HTTPConstants.CONNECTION_TIMEOUT,new
Integer(480000));

thanks,
dims

On 5/25/06, Jim Peterson <ji...@issinc.com> wrote:
>
>
>
>
> PROBLEM:  When an extremely large data set (i.e. 72 Mb of XML) is attempted
> to be serialized and sent from the server using the OMSourcedElementImpl
> with an OMDataSource, the XML streaming stops fairly early on with a
> XMLStreamException shown below (note that the stack trace can only be seen
> if you modify the StreamingOMSerializer to print it out):
>
>
>
> 17:03:03,562 INFO  [STDOUT]
> javax.xml.stream.XMLStreamException
>
> 17:03:03,562 INFO  [STDOUT]     at
> com.ctc.wstx.sw.BaseNsStreamWriter.doWriteStartTag(BaseNsStreamWr
>
> iter.java:495)
>
> 17:03:03,562 INFO  [STDOUT]     at
> com.ctc.wstx.sw.SimpleNsStreamWriter.writeStartOrEmpty(SimpleNsSt
>
> reamWriter.java:247)
>
> 17:03:03,562 INFO  [STDOUT]     at
> com.ctc.wstx.sw.BaseNsStreamWriter.writeStartElement(BaseNsStream
>
> Writer.java:273)
>
> 17:03:03,562 INFO  [STDOUT]     at
> org.apache.axiom.om.impl.MTOMXMLStreamWriter.writeStartElement(MT
>
> OMXMLStreamWriter.java:87)
>
> 17:03:03,578 INFO  [STDOUT]     at
> org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serializ
>
> eElement(StreamingOMSerializer.java:129)
>
> 17:03:03,578 INFO  [STDOUT]     at
> org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serializ
>
> eNode(StreamingOMSerializer.java:79)
>
> 17:03:03,578 INFO  [STDOUT]     at
> org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serializ
>
> e(StreamingOMSerializer.java:60)
>
> 17:03:03,578 INFO  [STDOUT]     at
> org.apache.axiom.om.impl.util.OMSerializerUtil.serializeByPullStr
>
> eam(OMSerializerUtil.java:315)
>
> 17:03:03,578 INFO  [STDOUT]     at
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OME
>
> lementImpl.java:786)
>
> 17:03:03,593 INFO  [STDOUT]     at
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndC
>
> onsume(OMElementImpl.java:809)
>
> 17:03:03,593 INFO  [STDOUT]     at
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OME
>
> lementImpl.java:780)
>
> 17:03:03,593 INFO  [STDOUT]     at
> org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerializ
>
> e(SOAPEnvelopeImpl.java:171)
>
> 17:03:03,593 INFO  [STDOUT]     at
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndC
>
> onsume(OMElementImpl.java:809)
>
> 17:03:03,609 INFO  [STDOUT]     at
> org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNo
>
> deImpl.java:381)
>
> 17:03:03,609 INFO  [STDOUT]     at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUs
>
> ingOutputStream(CommonsHTTPTransportSender.java:256)
>
> 17:03:03,609 INFO  [STDOUT]     at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke
>
> (CommonsHTTPTransportSender.java:210)
>
> 17:03:03,609 INFO  [STDOUT]     at
> org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:589)
>
>
>
>
>
> CORRECTION:  In the server axis2.xml file, set the enableMTOM parameter to
> true.  This allows the entire data set to be serialized to the client.
> Server memory spikes, but comes back down.
>
>
>
> Why does MTOM have to enable on the server to make this work?  Is there a
> way to make large data set returns work without using MTOM?  We would rather
> not use MTOM in our server responses.
>
>
>
> RELATED PROBLEM:  Even with MTOM set on the server side and client side
> memory set to a high level, the client throws the following Read timed out
> exception when trying to receive the large data set return:
>
>
>
> org.apache.axis2.AxisFault: Read timed out; nested exception is:
>
>       java.net.SocketTimeoutException: Read timed out; nested exception is:
>
>       org.apache.axis2.AxisFault: Read timed out; nested exception is:
>
>       java.net.SocketTimeoutException: Read timed out
>
>       at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:223)
>
>       at
> org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:589)
>
>       at
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:328)
>
>       at
> org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:279)
>
>       at
> org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:457)
>
>       at
> org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:399)
>
>       at
> ipt.tas.gateway.service.data_maint.DataMaintenanceServiceTest.testLoadedQuery(DataMaintenanceServiceTest.java:474)
>
>       at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
>       at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
>       at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
>       at java.lang.reflect.Method.invoke(Method.java:585)
>
>       at
> junit.framework.TestCase.runTest(TestCase.java:154)
>
>       at
> junit.framework.TestCase.runBare(TestCase.java:127)
>
>       at
> junit.framework.TestResult$1.protect(TestResult.java:106)
>
>       at
> junit.framework.TestResult.runProtected(TestResult.java:124)
>
>       at junit.framework.TestResult.run(TestResult.java:109)
>
>       at junit.framework.TestCase.run(TestCase.java:118)
>
>       at
> junit.framework.TestSuite.runTest(TestSuite.java:208)
>
>       at junit.framework.TestSuite.run(TestSuite.java:203)
>
>       at junit.textui.TestRunner.doRun(TestRunner.java:116)
>
>       at
> com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:57)
>
>       at junit.textui.TestRunner.start(TestRunner.java:172)
>
>       at
> com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTestRunner2.java:23)
>
>       at
> com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:97)
>
>       at
> com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31)
>
>
>
> Thanks,
>
> Jim
>
>


-- 
Davanum Srinivas : http://wso2.com/blogs/

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org