1

I am working on transfer large size file, and finally ended with MTOM implementation. we created MTOM enabled web service and client, and tested the client as a plain Java program. and we were able to send 1 GB file successfully. the main point here the heap at client place were not even increasing more than 70 MB.

But when I tried to initiate the same call from web-logic container (means created web client), we end up with below OOM Exception.

at

weblogic.utils.io.UnsyncByteArrayOutputStream.resizeBuffer(UnsyncByteArrayOutputStream.java:59)
      at weblogic.utils.io.UnsyncByteArrayOutputStream.write(UnsyncByteArrayOutputStream.java:89)
      at javax.activation.DataHandler.writeTo(DataHandler.java:293)
      at com.sun.xml.ws.encoding.MtomCodec$ByteArrayBuffer.write(MtomCodec.java:196)
      at com.sun.xml.ws.encoding.MtomCodec.encode(MtomCodec.java:163)
      at com.sun.xml.ws.encoding.SOAPBindingCodec.encode(SOAPBindingCodec.java:258)
      at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:142)
      at com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:86)
      at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:598)
      at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:557)
      at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:542)
      at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:439)
      at com.sun.xml.ws.client.Stub.process(Stub.java:248)
      at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:135)
      at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:109)
      at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
      at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:118)
      at $Proxy101.uploadFile(Unknown Source)

anyu one have any idea

UPDATE: it seems the MTOM settings are not effective when we run the program in web-logic container ! but still I am not able to find the solution

UPDATE 2: it seems weblogic is not supporting streaming ! I will update the weblogic version and update the ticket, till them wish me luck..

Pedantic
  • 1,368
  • 10
  • 39
  • 70
  • could you please share the example code? I am trying to write the same but for unknown reason the client buffers the entire data in memory – yolob 21 Apr 28 '20 at 14:55

1 Answers1

-1

Add this additional Java/JVM Option in setDomainEnv.sh

EXTRA_JAVA_PROPERTIES="-DUseSunHttpHandler=true ${EXTRA_JAVA_PROPERTIES}"
export EXTRA_JAVA_PROPERTIES

switches from weblogic specific (weblogic.net.http.HttpURLConnection) to sun's HTTP handler.

This solved my issue.

Refer:

Changing HttpURLConnection in running jvm

http://atgtipsandtweaks.blogspot.com/2011/11/weblogicjava-httphandler-issues.html

Thanks!

Community
  • 1
  • 1