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

java/net/URLPermission/URLTest.java fails intermittently with BindException

    Details

    • Subcomponent:
    • Resolved In Build:
      b129

      Description

      java/net/URLPermission/URLTest.java fails intermittently with java.net.BindException: Address already in use

      Test hard code port and could cause this issue, especially when tests run in concurrency.


          // These ports need to be hard-coded until we support port number
          // ranges in the permission class

          static final int PORT1 = 12567;
          static final int PORT2 = 12568;



      #section:main
      ----------messages:(3/147)----------
      command: main URLTest one
      reason: User specified action: run main/othervm/java.security.policy=policy.1 URLTest one
      elapsed time (seconds): 0.179
      ----------System.out:(0/0)----------
      ----------System.err:(23/1311)----------
      java.net.BindException: Address already in use
      at sun.nio.ch.Net.bind0(Native Method)
      at sun.nio.ch.Net.bind(Net.java:433)
      at sun.nio.ch.Net.bind(Net.java:425)
      at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
      at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
      at sun.net.httpserver.ServerImpl.<init>(ServerImpl.java:101)
      at sun.net.httpserver.HttpServerImpl.<init>(HttpServerImpl.java:50)
      at sun.net.httpserver.DefaultHttpServerProvider.createHttpServer(DefaultHttpServerProvider.java:35)
      at com.sun.net.httpserver.HttpServer.create(HttpServer.java:130)
      at URLTest.createServers(URLTest.java:202)
      at URLTest.main(URLTest.java:58)
      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:502)
      at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:92)
      at java.lang.Thread.run(Thread.java:745)

      JavaTest Message: Test threw exception: java.net.BindException: Address already in use
      JavaTest Message: shutting down test

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                chegar Chris Hegarty
                Reporter:
                amlu Amy Lu
              • Votes:
                0 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: