Web services SpringWebService服务器在大型附件上崩溃
我正在编写一个SpringWebService服务器,需要将一个大文件从客户端上传到服务器。到目前为止,它在100MB之前是正常的,但在100MB之后它会崩溃,并出现outofmemory错误Web services SpringWebService服务器在大型附件上崩溃,web-services,spring,attachment,Web Services,Spring,Attachment,我正在编写一个SpringWebService服务器,需要将一个大文件从客户端上传到服务器。到目前为止,它在100MB之前是正常的,但在100MB之后它会崩溃,并出现outofmemory错误 <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"> <property name="contextPath" value="epost.mojito.ws.wsdl" />
<bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
<property name="contextPath" value="epost.mojito.ws.wsdl" />
<property name="mtomEnabled" value="true"></property>
</bean>
<bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory">
<description>A message factory to support SOAP 1.2</description>
<property name="soapVersion">
<util:constant static-field="org.springframework.ws.soap.SoapVersion.SOAP_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>
java.lang.OutOfMemoryError:java堆空间
位于java.util.Arrays.copyOf(Arrays.java:2882)
位于java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
位于java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:515)
位于java.lang.StringBuilder.append(StringBuilder.java:189)
位于com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleCharacters(StAXStreamConnector.java:323)
位于com.sun.xml.bind.v2.runtime.unmarshaller.statxstreamconnector.bridge(statxstreamconnector.java:187)
位于com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:360)
<bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
<property name="contextPath" value="epost.mojito.ws.wsdl" />
<property name="mtomEnabled" value="true"></property>
</bean>
<bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory">
<description>A message factory to support SOAP 1.2</description>
<property name="soapVersion">
<util:constant static-field="org.springframework.ws.soap.SoapVersion.SOAP_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>
这是我的配置:
<bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
<property name="contextPath" value="epost.mojito.ws.wsdl" />
<property name="mtomEnabled" value="true"></property>
</bean>
<bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory">
<description>A message factory to support SOAP 1.2</description>
<property name="soapVersion">
<util:constant static-field="org.springframework.ws.soap.SoapVersion.SOAP_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>
<bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
<property name="contextPath" value="epost.mojito.ws.wsdl" />
<property name="mtomEnabled" value="true"></property>
</bean>
<bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory">
<description>A message factory to support SOAP 1.2</description>
<property name="soapVersion">
<util:constant static-field="org.springframework.ws.soap.SoapVersion.SOAP_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>
支持SOAP 1.2的消息工厂
请帮忙!!。。。谢谢我不确定,但我发现这个线程有一些调整,他设法发送了900MB。看一看,您好,该链接用于客户端发送。我正试图让我的服务器接受这个大文件。thankslink已经死了,请把它换掉
<bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
<property name="contextPath" value="epost.mojito.ws.wsdl" />
<property name="mtomEnabled" value="true"></property>
</bean>
<bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory">
<description>A message factory to support SOAP 1.2</description>
<property name="soapVersion">
<util:constant static-field="org.springframework.ws.soap.SoapVersion.SOAP_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>