Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-2865

DispatchClientServerTest fails on Windows

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3
    • 2.2.10
    • JAX-WS Runtime
    • None
    • Windows Vista 64 bit

    • Moderate

    Description

      The test DispatchClientServerTest fails with: java.lang.AssertionError: java.net.SocketTimeoutException.
      Stack trace for the exception:
      Caused by: java.net.SocketTimeoutException: connect timed out
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
      at java.net.Socket.connect(Socket.java:529)
      at sun.net.NetworkClient.doConnect(NetworkClient.java:158)
      at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
      at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
      at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
      at sun.net.www.http.HttpClient.New(HttpClient.java:306)
      at sun.net.www.http.HttpClient.New(HttpClient.java:323)
      at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:860)
      at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:801)
      at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:726)
      at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:904)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1869)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1821)
      at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:42)
      at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1889)

      The causes for the issue are twofold:
      1. On Windows a failed connection to localhost takes 'some time' to fail, on Linux and MacOS it fails instantly.
      2. The exception for a failed connection is java.net.ConnectException, but the exception for a timed out connection is java.net.SocketTimeoutException.
      So on Windows the SocketTimeoutException is seen and on Linux and MacOS the ConnectException is seen - not even Java can paper over OS level differences here.
      The test currently only considers the ConnectException to be valid, and thus fails on Windows.

      Attachments

        Activity

          People

            dkulp Daniel Kulp
            yaytay Yaytay
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified