我正在寫一個春季web服務服務器,需要上傳一個大型文件從客戶端到服務器。到目前爲止,它可以直到100MB,但在此之後它會崩潰,出現內存不足錯誤。春季web服務服務器崩潰的大型附件
java.lang.OutOfMemoryError:在java.lang中的Java堆空間 在java.util.Arrays.copyOf(Arrays.java:2882) 在java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100) .AbstractStringBuilder.append(AbstractStringBuilder.java:515) at java.lang.StringBuilder.append(StringBuilder.java:189) at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleCharacters(StAXStreamConnector.java :323) at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:187) at 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>
請幫助!...謝謝
嗨,鏈接是爲客戶端發送。我試圖讓我的服務器接受大文件。謝謝 – user1521469 2012-07-12 18:00:52