Announcement Announcement Module
Collapse
No announcement yet.
spring webservice server with large attachment Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring webservice server with large attachment

    Hi,

    I'm trying to create spring webservice server that's able to accept large attachment. So far it fail around 100 MB. I'm using AxiomSoapMessageFactory and setting attachment caching to true but it still fail with outofmemory error:

    java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:2882)
    at java.lang.AbstractStringBuilder.expandCapacity(Abs tractStringBuilder.java:100)
    at java.lang.AbstractStringBuilder.append(AbstractStr ingBuilder.java:515)
    at java.lang.StringBuilder.append(StringBuilder.java: 189)
    at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStrea mConnector.handleCharacters(StAXStreamConnector.ja va:323)
    at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStrea mConnector.bridge(StAXStreamConnector.java:187)
    at com.sun.xml.bind.v2.runtime.unmarshaller.Unmarshal lerImpl.unmarshal0(UnmarshallerImpl.java:360)
    at com.sun.xml.bind.v2.runtime.unmarshaller.Unmarshal lerImpl.unmarshal(UnmarshallerImpl.java:332)
    at org.springframework.ws.server.endpoint.adapter.met hod.jaxb.AbstractJaxb2PayloadMethodProcessor$Jaxb2 SourceCallback.staxSource(AbstractJaxb2PayloadMeth odProcessor.java:247)
    at org.springframework.xml.transform.TraxUtils.doWith Source(TraxUtils.java:90)
    at org.springframework.ws.server.endpoint.adapter.met hod.jaxb.AbstractJaxb2PayloadMethodProcessor.unmar shalFromRequestPayload(AbstractJaxb2PayloadMethodP rocessor.java:125)
    at org.springframework.ws.server.endpoint.adapter.met hod.jaxb.XmlRootElementPayloadMethodProcessor.reso lveArgument(XmlRootElementPayloadMethodProcessor.j ava:49)
    at org.springframework.ws.server.endpoint.adapter.Def aultMethodEndpointAdapter.getMethodArguments(Defau ltMethodEndpointAdapter.java:259)
    at org.springframework.ws.server.endpoint.adapter.Def aultMethodEndpointAdapter.invokeInternal(DefaultMe thodEndpointAdapter.java:220)


    Here's my config:
    <bean id="marshallingPayloadMethodProcessor"
    class="org.springframework.ws.server.endpoint.adap ter.method.MarshallingPayloadMethodProcessor">
    <constructor-arg ref="marshaller" />
    </bean>

    <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshalle r">
    <property name="contextPath" value="epost.mojito.ws.wsdl" />
    <property name="mtomEnabled" value="true"></property>
    </bean>

    <bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoap MessageFactory">
    <description>A message factory to support SOAP 1.2</description>
    <property name="soapVersion">
    <util:constant static-field="org.springframework.ws.soap.SoapVersion.SOA P_12" />
    </property>
    <property name="payloadCaching" value="false" />
    <property name="attachmentCaching" value="true" />
    <property name="attachmentCacheThreshold" value="1024"/>
    <property name="attachmentCacheDir" value="D:/mojito attachment test/cache"/>

    </bean>

    Please help, thanks

  • #2
    I've looked at the source code for AxiomSoapMessageFactory, and i've noticed that the attachmentCaching and attachmentCacheThreshold properties are only in used if the SOAP's Content type is an Multipart message. My question is then how do I create a Soap Multipart request ?

    thanks

    Comment

    Working...
    X