我正在尝试通过SOAP UI(启用MTOM)上传大小为350 MB的附件,并将附件发送到axis2 Web服务。
Axis2 Web服务配置为在服务器端启用MTOM。并且在服务器端也启用了缓存。以下配置在axis2.xml中:
<parameter name="enableMTOM">true</parameter>
和
<parameter name="cacheAttachments">true</parameter>
<parameter name="attachmentDIR">C:\Temp\TempWS</parameter>
<parameter name="sizeThreshold">8000</parameter>
tomcat中的最大堆大小设置为3000 MB(参见上面的屏幕截图),但仍然是Web服务使我低于异常:
Java heap space
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOfRange(Arrays.java:2694)
at java.lang.String.<init>(String.java:203)
at java.lang.StringBuffer.toString(StringBuffer.java:561)
at org.apache.axiom.util.base64.Base64Utils.encode(Base64Utils.java:81)
at org.apache.axiom.om.impl.llom.OMTextImpl.getText(OMTextImpl.java:264)
at org.apache.axiom.om.impl.llom.OMElementImpl.getText(OMElementImpl.java:786)
at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:334)
at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:407)
at org.apache.axis2.databinding.utils.BeanUtil.processObject(BeanUtil.java:682)
at org.apache.axis2.databinding.utils.BeanUtil.ProcessElement(BeanUtil.java:630)
at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:562)
at org.apache.axis2.rpc.receivers.RPCUtil.processRequest(RPCUtil.java:153)
at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:188)
at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:102)
at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:173)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:173)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:144)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at com.csdcsystems.amanda.servlet.AmandaAxisServlet.service(AmandaAxisServlet.java:103)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
我的问题:
注意: 服务配置为将byte []作为服务的输入/输出参数。
答案 0 :(得分:0)
尝试使用
增加堆空间C:\tomcat-7.0.57\bin>set JAVA_OPTS=-Xmx1g
C:\tomcat-7.0.57\bin>startup.bat
这将运行带有1GB堆空间的jvm,如果仍然抛出异常尝试2g。
如果您通过eclipse运行tomcat,请转到&#34;运行配置&#34;,选择您的项目,打开&#34; Arguments&#34;选项卡并将-Xmx1g添加到&#34; VM参数&#34;