Announcement Announcement Module
Collapse
No announcement yet.
MTOM OutOfMemoryError Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • MTOM OutOfMemoryError

    I have a WS using MTOM binary data for part of the message. The service works for smaller data sets < 2MB; however, throws OutOfMemoryException for content of 50MB. I've seen the sample applications and believe my setup is correct since it appears to work for smaller data sizes.

    Here is the exception:

    Code:
    (FrameworkServlet.java:910) DEBUG org.springframework.ws.transport.http.MessageDispatcherServlet  - Could not complete request
    java.lang.OutOfMemoryError: Java heap space
    	at java.util.Arrays.copyOf(Arrays.java:2882)
    	at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
    	at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390)
    	at java.lang.StringBuilder.append(StringBuilder.java:119)
    	at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:168)
    	at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:88)
    	at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:59)
    	at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:239)
    	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
    	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    	at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    	at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
    	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
    	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3732)
    	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
    	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    	at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    	at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
    	at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
    	at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
    	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
    	at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    And here are my configurations:

    Spring context:
    Code:
    <sws:annotation-driven marshaller="marshaller" unmarshaller="marshaller" />
        <context:annotation-config />
    	<context:component-scan base-package="ca.something" />
    
    	<bean class="org.springframework.ws.transport.http.XsdSchemaHandlerAdapter" />
    	
    	<!-- Exposing the WSDL to clients. -->
    	<sws:static-wsdl id="dataUpload" location="/WEB-INF/wsdl/ca/something/Transfer.wsdl"/>
    
            <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
    		<property name="classesToBeBound">
    			<list>
    				<value>...</value>
                            </list>
    		</property>
    		<property name="mtomEnabled" value="true" />
    	</bean>
    
            <bean id="marshallingPayloadMethodProcessor"
    		class="org.springframework.ws.server.endpoint.adapter.method.MarshallingPayloadMethodProcessor">
    		<constructor-arg ref="marshaller" />
    		<constructor-arg ref="marshaller" />
    	</bean>
    	
    	<bean id="defaultMethodEndpointAdapter"
    		class="org.springframework.ws.server.endpoint.adapter.DefaultMethodEndpointAdapter">
    		<property name="methodArgumentResolvers">
    			<list>
    				<ref bean="marshallingPayloadMethodProcessor" />
    			</list>
    		</property>
    		<property name="methodReturnValueHandlers">
    			<list>
    				<ref bean="marshallingPayloadMethodProcessor" />
    			</list>
    		</property>
    	</bean>
    Here is the schema config:

    Code:
    <xsd:complexType name="metricsType">
    				<xsd:all>
    					<xsd:element name="metricData" type="xsd:base64Binary"
    						xmime:expectedContentTypes="*/*" />
    				</xsd:all>
    			</xsd:complexType>
    Appreciate your help.

  • #2
    What can I say - little bit of thinking goes a long way. Partial victory - for 50MB file the problem was solved by turning off the trace logging on org.springframework which I was using to debug my wiring problems earlier. However, for 180MB file, OutOfMemoryException still occurs.
    Last edited by pdurcek; May 10th, 2013, 12:09 AM.

    Comment


    • #3
      Here is the new exception:

      Code:
      MessageDispatcherServlet  - Could not complete request
      java.lang.OutOfMemoryError: Java heap space
      	at weblogic.xml.babel.scanner.ScannerState.addToBuffer(ScannerState.java:287)
      	at weblogic.xml.babel.scanner.ScannerState.read(ScannerState.java:395)
      	at weblogic.xml.babel.scanner.ScannerState.checkedRead(ScannerState.java:626)
      	at weblogic.xml.babel.scanner.CharData.read(CharData.java:65)
      	at weblogic.xml.babel.scanner.Scanner.startState(Scanner.java:296)
      	at weblogic.xml.babel.scanner.Scanner.scan(Scanner.java:178)
      	at weblogic.xml.babel.baseparser.BaseParser.accept(BaseParser.java:533)
      	at weblogic.xml.babel.baseparser.CharDataElement.parse(CharDataElement.java:91)
      	at weblogic.xml.babel.baseparser.BaseParser.parseElement(BaseParser.java:481)
      	at weblogic.xml.babel.baseparser.BaseParser.parseSome(BaseParser.java:326)
      	at weblogic.xml.stax.XMLStreamReaderBase.advance(XMLStreamReaderBase.java:195)
      	at weblogic.xml.stax.XMLStreamReaderBase.next(XMLStreamReaderBase.java:237)
      	at weblogic.xml.domimpl.Loader.load(Loader.java:207)
      	at weblogic.xml.domimpl.Loader.load(Loader.java:96)
      	at weblogic.xml.saaj.SOAPPartImpl.createDocumentFromInputStream(SOAPPartImpl.java:145)
      	at weblogic.xml.saaj.SOAPMessageImpl.createSOAPPart(SOAPMessageImpl.java:467)
      	at weblogic.xml.saaj.SOAPMessageImpl.constructMessage(SOAPMessageImpl.java:225)
      	at weblogic.xml.saaj.SOAPMessageImpl.<init>(SOAPMessageImpl.java:151)
      	at weblogic.xml.saaj.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:76)
      	at weblogic.xml.saaj.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:63)
      	at weblogic.xml.saaj.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:55)
      	at org.springframework.ws.soap.saaj.SaajSoapMessageFactory.createWebServiceMessage(SaajSoapMessageFactory.java:184)
      	at org.springframework.ws.soap.saaj.SaajSoapMessageFactory.createWebServiceMessage(SaajSoapMessageFactory.java:60)
      	at org.springframework.ws.transport.AbstractWebServiceConnection.receive(AbstractWebServiceConnection.java:90)
      	at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:86)
      	at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:59)
      	at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:239)
      	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
      	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      	at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)

      Comment

      Working...
      X