Announcement Announcement Module
Collapse
No announcement yet.
out of memory error using axiomsoapmessagefactory and jaxb2marshaller Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • out of memory error using axiomsoapmessagefactory and jaxb2marshaller

    My jaxb2marshaller has mtomEnabled=true

    I have declared messagefactory

    Code:
    <bean id="CSmessageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory">
            <property name="payloadCaching" value="false"/>
    </bean>
    I refer to this in my gateway definition
    <property name="messageFactory" ref="CSmessageFactory"/>

    my web service extends WebServiceGatewaySupport and calls
    getWebServiceTemplate().marshalSendAndReceive(requ est);

    my endpoint extends AbstractMarshallingPayloadEndpoint and overrides invokeInternal

    I am trying to upload a large xml file

    I get the following error
    Code:
    Caused by: java.lang.OutOfMemoryError: allocLargeObjectOrArray - Object size: 176257144, Num elements: 88128564
    	at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:99)
    	at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:518)
    	at java.lang.StringBuffer.append(StringBuffer.java:307)
    	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleCharacters(XMLSchemaValidator.java:1603)
    	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.characters(XMLSchemaValidator.java:758)
    	at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorHandlerImpl.characters(ValidatorHandlerImpl.java:353)
    	at org.xml.sax.helpers.XMLFilterImpl.characters(XMLFilterImpl.java:564)
    	at com.sun.xml.bind.v2.runtime.output.SAXOutput.text(SAXOutput.java:138)
    	at com.sun.xml.bind.v2.runtime.output.ForkXmlOutput.text(ForkXmlOutput.java:87)
    	at com.sun.xml.bind.v2.runtime.XMLSerializer.leafElement(XMLSerializer.java:312)
    	at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$PcdataImpl.writeLeafElement(RuntimeBuiltinLeafInfoImpl.java:140)
    	at com.sun.xml.bind.v2.runtime.MimeTypedTransducer.writeLeafElement(MimeTypedTransducer.java:56)
    	at com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.writeLeafElement(TransducedAccessor.java:206)
    	at com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty.serializeBody(SingleElementLeafProperty.java:62)
    	at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:293)
    	at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsSoleContent(XMLSerializer.java:532)
    	at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeRoot(ClassBeanInfoImpl.java:283)
    	at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:461)
    	at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:292)
    	at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:148)
    	at org.springframework.oxm.jaxb.Jaxb2Marshaller.marshalStaxResult(Jaxb2Marshaller.java:390)
    	at org.springframework.oxm.jaxb.Jaxb2Marshaller.marshal(Jaxb2Marshaller.java:376)
    	at org.springframework.ws.support.MarshallingUtils.marshal(MarshallingUtils.java:81)
    	at org.springframework.ws.client.core.WebServiceTemplate$2.doWithMessage(WebServiceTemplate.java:360)
    	at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:535)
    	at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:502)
    	at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:351)
    	at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:345)
    	at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:337)
    The schema defines the xml as base 64 encoded

    Can anyone suggest what I am doing wrong, please?

    Thanks
    Last edited by drellim; Jul 23rd, 2009, 12:15 PM. Reason: add info

  • #2
    OOME follow up

    I removed all reference to the schema, and now the stack trace is

    Code:
    Caused by: java.lang.OutOfMemoryError: allocLargeObjectOrArray - Object size: 176257144, Num elements: 88128564
    	at java.lang.String.<init>(String.java:174)
    	at com.sun.xml.bind.DatatypeConverterImpl._printBase64Binary(DatatypeConverterImpl.java:628)
    	at com.sun.xml.bind.v2.runtime.unmarshaller.Base64Data.toString(Base64Data.java:252)
    	at com.sun.xml.bind.v2.runtime.output.XMLStreamWriterOutput.text(XMLStreamWriterOutput.java:120)
    	at com.sun.xml.bind.v2.runtime.XMLSerializer.leafElement(XMLSerializer.java:312)
    	at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$PcdataImpl.writeLeafElement(RuntimeBuiltinLeafInfoImpl.java:140)
    	at com.sun.xml.bind.v2.runtime.MimeTypedTransducer.writeLeafElement(MimeTypedTransducer.java:56)
    	at com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.writeLeafElement(TransducedAccessor.java:206)
    	at com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty.serializeBody(SingleElementLeafProperty.java:62)
    	at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:293)
    	at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsSoleContent(XMLSerializer.java:532)
    	at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeRoot(ClassBeanInfoImpl.java:283)
    	at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:461)
    	at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:292)
    	at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:148)
    	at org.springframework.oxm.jaxb.Jaxb2Marshaller.marshalStaxResult(Jaxb2Marshaller.java:390)
    	at org.springframework.oxm.jaxb.Jaxb2Marshaller.marshal(Jaxb2Marshaller.java:376)
    	at org.springframework.ws.support.MarshallingUtils.marshal(MarshallingUtils.java:81)
    	at org.springframework.ws.client.core.WebServiceTemplate$2.doWithMessage(WebServiceTemplate.java:360)
    	at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:535)
    	at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:502)
    	at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:351)
    	at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:345)
    	at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:337)

    Comment

    Working...
    X