Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8166600

Closing MIME boundary missing

XMLWordPrintable

    • x86_64
    • windows_7

      FULL PRODUCT VERSION :
      java version "1.8.0_45"
      Java(TM) SE Runtime Environment (build 1.8.0_45-b15)
      Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      I am using
      jaxws-spring 1.9
      jaxws-rt 2.2.8
      jaxws-api 2.2.8

      A DESCRIPTION OF THE PROBLEM :
      A web service call fails with the message "Reached EOF, but there is no closing MIME boundary."
      This is reproducible with several web services but I assume it is related to one service having MTOM enabled. However, the MTOM feature need not
      actually be used in the test to provoke the error. It suffices that the service contains the MTOM annotation for another method. The error does
      not occur when removing the MTOM annotation from the service. However, this makes the service prohibitively slow as we use MTOM to stream very
      large structured result sets. If I execute a series of, like, 10 similar test cases, usually only the first fails. Sometimes also one of the other
      tests fails.

      This is the result of logging at the client with these options:
      -Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true
      -Dcom.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump=true

      ---[HTTP request - http://localhost:8082/Sap]---
      Accept: text/xml, multipart/related
      Content-Type: multipart/related;start="<rootpart*f87b6b74-442b-499a-bdb2-bc6fa23d36a1@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:f87b6b74-442b-499a-bdb2-bc6fa23d36a1";start-info="text/xml"
      SOAPAction: "http://sap.tn_ag.com/SapConnectionWS/getInfoProvidersRequest"
      User-Agent: JAX-WS RI 2.2.8 svn-revision#13980
      --uuid:f87b6b74-442b-499a-bdb2-bc6fa23d36a1
      Content-Id: <rootpart*f87b6b74-442b-499a-bdb2-bc6fa23d36a1@example.jaxws.sun.com>
      Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
      Content-Transfer-Encoding: binary

      <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:getInfoProviders xmlns:ns2="http://sap.tn_ag.com/"><arg0><id>1</id><client>100</client><destination>vm-sapbw-01</destination><ns2:dso internalName="internalName" name="name"/><infoProviderType>DSO</infoProviderType><language>en</language><password>secret</password><sysNo>0</sysNo><user>anyuser</user></arg0><arg1>INFOCUBE</arg1></ns2:getInfoProviders></S:Body></S:Envelope>
      --uuid:f87b6b74-442b-499a-bdb2-bc6fa23d36a1----------------------

      ---[HTTP response - http://localhost:8082/Sap - 200]---
      null: HTTP/1.1 200 OK
      Content-Type: multipart/related;start="<rootpart*9153f34c-b9b0-4135-9fc6-aada4851baa5@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:9153f34c-b9b0-4135-9fc6-aada4851baa5";start-info="text/xml"
      Server: Jetty(8.1.16.v20140903)
      Transfer-Encoding: chunked
      --uuid:9153f34c-b9b0-4135-9fc6-aada4851baa5
      Content-Id: <rootpart*9153f34c-b9b0-4135-9fc6-aada4851baa5@example.jaxws.sun.com>
      Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
      Content-Transfer-Encoding: binary

      <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:getInfoProvidersResponse xmlns:ns2="http://sap.tn_ag.com/"><return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:infoCubeType" internalName="cubeInternalName1" name="cubeName1"/><return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:infoCubeType" internalName="cubeInternalName2" name="cubeName2"/></ns2:getInfoProvidersResponse></S:Body></S:Envelope>--------------------

      Here, the closing uuid MIME-boundary is missing in the end.
      Wireshark shows that the response received from the server via TCP does indeed contain the uuid closing the attachment frame.

      This is the output I get with both client- and server-side logging enabled:
      -Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true
      -Dcom.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump=true
      -Dcom.sun.xml.ws.transport.http.HttpAdapter.dump=true
      -Dcom.sun.xml.internal.ws.transport.http.HttpAdapter.dump=true

      ---[HTTP request - http://localhost:8082/Sap]---
      Accept: text/xml, multipart/related
      Content-Type: multipart/related;start="<rootpart*7f7c8d3c-956f-496a-a794-0820dd29e328@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:7f7c8d3c-956f-496a-a794-0820dd29e328";start-info="text/xml"
      SOAPAction: "http://sap.tn_ag.com/SapConnectionWS/getInfoProvidersRequest"
      User-Agent: JAX-WS RI 2.2.8 svn-revision#13980
      --uuid:7f7c8d3c-956f-496a-a794-0820dd29e328
      Content-Id: <rootpart*7f7c8d3c-956f-496a-a794-0820dd29e328@example.jaxws.sun.com>
      Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
      Content-Transfer-Encoding: binary

      <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:getInfoProviders xmlns:ns2="http://sap.tn_ag.com/"><arg0><id>1</id><client>100</client><destination>vm-sapbw-01</destination><ns2:dso internalName="internalName" name="name"/><infoProviderType>DSO</infoProviderType><language>en</language><password>secret</password><sysNo>0</sysNo><user>anyuser</user></arg0><arg1>INFOCUBE</arg1></ns2:getInfoProviders></S:Body></S:Envelope>
      --uuid:7f7c8d3c-956f-496a-a794-0820dd29e328----------------------

      ---[HTTP request]---
      Accept: text/xml, multipart/related
      Connection: keep-alive
      Content-Length: 766
      Content-Type: multipart/related;start="<rootpart*7f7c8d3c-956f-496a-a794-0820dd29e328@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:7f7c8d3c-956f-496a-a794-0820dd29e328";start-info="text/xml"
      Host: localhost:8082
      SOAPAction: "http://sap.tn_ag.com/SapConnectionWS/getInfoProvidersRequest"
      User-Agent: JAX-WS RI 2.2.8 svn-revision#13980
      --uuid:7f7c8d3c-956f-496a-a794-0820dd29e328
      Content-Id: <rootpart*7f7c8d3c-956f-496a-a794-0820dd29e328@example.jaxws.sun.com>
      Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
      Content-Transfer-Encoding: binary

      <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:getInfoProviders xmlns:ns2="http://sap.tn_ag.com/"><arg0><id>1</id><client>100</client><destination>vm-sapbw-01</destination><ns2:dso internalName="internalName" name="name"/><infoProviderType>DSO</infoProviderType><language>en</language><password>secret</password><sysNo>0</sysNo><user>anyuser</user></arg0><arg1>INFOCUBE</arg1></ns2:getInfoProviders></S:Body></S:Envelope>
      --uuid:7f7c8d3c-956f-496a-a794-0820dd29e328----------------------

      ---[HTTP response 200]---
      --uuid:10918fda-fb31-46c7-980b-cba757e0b15f
      Content-Id: <rootpart*10918fda-fb31-46c7-980b-cba757e0b15f@example.jaxws.sun.com>
      Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
      Content-Transfer-Encoding: binary

      <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:getInfoProvidersResponse xmlns:ns2="http://sap.tn_ag.com/"><return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:infoCubeType" internalName="cubeInternalName1" name="cubeName1"/><return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:infoCubeType" internalName="cubeInternalName2" name="cubeName2"/></ns2:getInfoProvidersResponse></S:Body></S:Envelope>
      --uuid:10918fda-fb31-46c7-980b-cba757e0b15f----------------------

      ---[HTTP response - http://localhost:8082/Sap - 200]---
      null: HTTP/1.1 200 OK
      Content-Length: 786
      Content-Type: multipart/related;start="<rootpart*10918fda-fb31-46c7-980b-cba757e0b15f@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:10918fda-fb31-46c7-980b-cba757e0b15f";start-info="text/xml"
      Server: Jetty(8.1.16.v20140903)
      --uuid:10918fda-fb31-46c7-980b-cba757e0b15f
      Content-Id: <rootpart*10918fda-fb31-46c7-980b-cba757e0b15f@example.jaxws.sun.com>
      Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
      Content-Transfer-Encoding: binary

      <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:getInfoProvidersResponse xmlns:ns2="http://sap.tn_ag.com/"><return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:infoCubeType" internalName="cubeInternalName1" name="cubeName1"/><return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:infoCubeType" internalName="cubeInternalName2" name="cubeName2"/></ns2:getInfoProvidersResponse></S:Body></S:Envelope>
      --uuid:10918fda-fb31-46c7-980b-cba757e0b15f----------------------

      However, the test takes extremely long in this case (200 seconds).
      Thus, If I disable server-side logging, the test runs faster but fails (in most cases but with a bit of randomness).




      REGRESSION. Last worked in version 7u80

      ADDITIONAL REGRESSION INFORMATION:
      I am not sure about the Java 7 version it was working with. However, it did definitely work fine for about a year. Regression happened about a month ago when updating to Java 8. However, the bug now also occurs on Java 7 versions. Also, it now happens with old versions of our software which definitely worked fine 2 months ago on Java 7. Therefore, this may not at all be related to the the Java version but rather to an update of windows which was buggy or incompatible with java.io?

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Define a SOAP web service using @MTOM.
      Define a web service method that returning a list of JAXB mapped objects.
      Call the web service method.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      A list of result objects.
      ACTUAL -
      An exception because an MIME attachment is not properly closed.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      com.sun.xml.ws.protocol.soap.MessageCreationException: SOAP-Nachricht konnte wegen folgender Ausnahme nicht erstellt werden: org.jvnet.mimepull.MIMEParsingException: Reached EOF, but there is no closing MIME boundary.
      at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:319)
      at com.sun.xml.ws.transport.http.client.HttpTransportPipe.createResponsePacket(HttpTransportPipe.java:281)
      at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:230)
      at com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:143)
      at com.sun.xml.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:110)
      at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1136)
      at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:1050)
      at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:1019)
      at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:877)
      at com.sun.xml.ws.client.Stub.process(Stub.java:464)
      at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:174)
      at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
      at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:91)
      at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:154)
      at com.sun.proxy.$Proxy99.getInfoProviders(Unknown Source)
      at com.tn_ag.sap.SapConnectionWSClient.getInfoProviders(SapConnectionWSClient.java:110)
      at com.tn_ag.sap.WsCommunicationTest.testGetInfoCubes(WsCommunicationTest.java:202)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
      Caused by: org.jvnet.mimepull.MIMEParsingException: Reached EOF, but there is no closing MIME boundary.
      at org.jvnet.mimepull.MIMEParser.readBody(MIMEParser.java:225)
      at org.jvnet.mimepull.MIMEParser.access$600(MIMEParser.java:68)
      at org.jvnet.mimepull.MIMEParser$MIMEEventIterator.next(MIMEParser.java:165)
      at org.jvnet.mimepull.MIMEParser$MIMEEventIterator.next(MIMEParser.java:132)
      at org.jvnet.mimepull.MIMEMessage.makeProgress(MIMEMessage.java:198)
      at org.jvnet.mimepull.DataHead.read(DataHead.java:144)
      at org.jvnet.mimepull.MIMEPart.read(MIMEPart.java:94)
      at com.sun.xml.ws.encoding.MimeMultipartParser$PartAttachment.asInputStream(MimeMultipartParser.java:228)
      at com.sun.xml.ws.encoding.MtomCodec.decode(MtomCodec.java:292)
      at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:363)
      at com.sun.xml.ws.encoding.MimeCodec.decode(MimeCodec.java:222)
      at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:306)
      ... 43 more

      REPRODUCIBILITY :
      This bug can be reproduced often.

      ---------- BEGIN SOURCE ----------
      This is the test case:

        @Test
        public void testGetInfoCubes() throws Exception {
          LOG.info("client:" + client);
          List<InfoProvider> result = client.getInfoProviders(getConnection(), InfoProviderType.INFOCUBE);
          LOG.info("{}", result);
          Assert.assertThat(result, is(equalTo(CUBES)));
        }
        
      This is the client:

        private SnafuWS connect() {
          Service result = null;
          try {
            result = Service.create(
                new URL(serviceUrl + "?wsdl"),
                new QName("http://snafu.tn_ag.com/", "SnafuWSImpl") );
          } catch ( MalformedURLException e ) {
            LOG.error(FATAL, "Could not create web service endpoint.", e);
          }
          SapConnectionWS port = result.getPort(SnafuWS.class);//, new MTOMFeature(), stf);
          return port;
        }
        
      The service:

      @WebService(endpointInterface = "com.tn_ag.sap.SnafuWS")
      @MTOM // enable Message Transmission Optimization Mechanism (MTOM) at the server
      @StreamingAttachment(parseEagerly = false, dir = "/tmp", memoryThreshold = 4000000L)
      public class SnafuWSImpl implements SnafuWS {
        ...
        @Override
        public List<InfoProvider> getInfoProviders(SapConnection connection, InfoProviderType pType) {
          SapConnect connect = createConnection(connection);
          List<InfoProvider> result = impl.selectInfoProviders(connect, pType);
          return result;
        }
        ...
      }
      ---------- END SOURCE ----------

            fmatte Fairoz Matte
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: