java.util.concurrent.ExecutionException: java.security.AccessControlException: access denied ("java.net.SocketPermission" "127.0.0.1:45470" "connect,resolve") at java.util.concurrent.CompletableFuture.reportGet(java.base@9-internal/CompletableFuture.java:395) at java.util.concurrent.CompletableFuture.get(java.base@9-internal/CompletableFuture.java:1999)

JDK Bug System | Felix Yang | 3 months ago
  1. 0

    According to the java doc " CompletableFuture<WebSocket> java.net.http.WebSocket.Builder.buildAsync() Builds a WebSocket. Returns a CompletableFuture<WebSocket> which completes normally with the WebSocket when it is connected or completes exceptionally if an error occurs. CompletableFuture may complete exceptionally with the following errors: ... • SecurityException if a security manager is set, and the caller does not have a java.net.URLPermission for the WebSocket URI ... " But, actually, it asks for following permissions: 1. java.net.URLPermission uri "GET:Sec-WebSocket-Key,Sec-WebSocket-Version" 2. java.lang.RuntimePermission "enableContextClassLoaderOverride" 3. java.net.SocketPermission "host:port" "connect,resolve" There are multiple problems here: for permission #1, is it the documented " java.net.URLPermission for the WebSocket URI "? Even yes, I suppose an example in document is needed. for permission #2, it is apparently not documented. for permission #3, not documented either. In addition, even I specified such permission, the test still fail. Please refer to the attached java file. Test output: java.util.concurrent.ExecutionException: java.security.AccessControlException: access denied ("java.net.SocketPermission" "127.0.0.1:45470" "connect,resolve") at java.util.concurrent.CompletableFuture.reportGet(java.base@9-internal/CompletableFuture.java:395) at java.util.concurrent.CompletableFuture.get(java.base@9-internal/CompletableFuture.java:1999) at WSPermissionTest.lambda$urlPermissionTest$6(WSPermissionTest.java:196) ... 11 more Caused by: java.security.AccessControlException: access denied ("java.net.SocketPermission" "127.0.0.1:45470" "connect,resolve") at java.security.AccessControlContext.checkPermission(java.base@9-internal/AccessControlContext.java:468) at java.security.AccessController.checkPermission(java.base@9-internal/AccessController.java:894) at java.lang.SecurityManager.checkPermission(java.base@9-internal/SecurityManager.java:548) at java.lang.SecurityManager.checkConnect(java.base@9-internal/SecurityManager.java:1050) at sun.nio.ch.SocketChannelImpl.connect(java.base@9-internal/SocketChannelImpl.java:627) at java.net.http.PlainHttpConnection.connect(java.httpclient@9-internal/PlainHttpConnection.java:122) at java.net.http.Http1Exchange.sendHeadersOnly(java.httpclient@9-internal/Http1Exchange.java:133) at java.net.http.ExchangeImpl.sendRequest(java.httpclient@9-internal/ExchangeImpl.java:176) at java.net.http.ExchangeImpl.lambda$sendRequestAsync$1(java.httpclient@9-internal/ExchangeImpl.java:184) at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@9-internal/ThreadPoolExecutor.java:1158) at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@9-internal/ThreadPoolExecutor.java:632) at java.lang.Thread.run(java.base@9-internal/Thread.java:843) at jdk.internal.misc.InnocuousThread.run(java.base@9-internal/InnocuousThread.java:122)

    JDK Bug System | 3 months ago | Felix Yang
    java.util.concurrent.ExecutionException: java.security.AccessControlException: access denied ("java.net.SocketPermission" "127.0.0.1:45470" "connect,resolve") at java.util.concurrent.CompletableFuture.reportGet(java.base@9-internal/CompletableFuture.java:395) at java.util.concurrent.CompletableFuture.get(java.base@9-internal/CompletableFuture.java:1999)
  2. 0

    This can be reproduced with following WebSocket scenario. But I don't think it is only a WebSocket problem. It looks to be a problem in current java.net.http.*HttpConnection implementation //A simple test to reproduce the problem public class WSReconnectTest { public static void main(String[] args) throws Exception { String wsURL = "your_ws_endpoint"; connect(wsURL); connect(wsURL); } /** * Tests send and receive plain text messages with different length. * @throws Exception */ static void connect(String url) throws Exception { Listener l = new Listener() { @Override public void onError(WebSocket webSocket, Throwable error) { System.err.println(error); error.printStackTrace(); } }; URI uri = new URI(url); WebSocket ws= WebSocket.newBuilder(uri, l).buildAsync().get(); ws.sendClose().get(); } } It will fail immediately at the second connect attempt. Please refer to the test output:----------System.err:(24/1946)---------- java.util.concurrent.ExecutionException: java.io.IOException: Connection closed at java.util.concurrent.CompletableFuture.reportGet(java.base@9-internal/CompletableFuture.java:395) at java.util.concurrent.CompletableFuture.get(java.base@9-internal/CompletableFuture.java:1999) at WSReconnectTest.connect(WSReconnectTest.java:58) at WSReconnectTest.main(WSReconnectTest.java:42) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-internal/Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-internal/NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-internal/DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(java.base@9-internal/Method.java:535) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:110) at java.lang.Thread.run(java.base@9-internal/Thread.java:843) Caused by: java.io.IOException: Connection closed at java.net.http.Http1Response.readHeaders(java.httpclient@9-internal/Http1Response.java:72) at java.net.http.Http1Exchange.lambda$getResponseAsyncImpl$0(java.httpclient@9-internal/Http1Exchange.java:190) at java.net.http.Utils.lambda$singleThreadExecutor$5(java.httpclient@9-internal/Utils.java:495) at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@9-internal/ThreadPoolExecutor.java:1158) at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@9-internal/ThreadPoolExecutor.java:632) at java.lang.Thread.run(java.base@9-internal/Thread.java:843) at jdk.internal.misc.InnocuousThread.run(java.base@9-internal/InnocuousThread.java:122) "java.io.IOException: Connection closed" is the cause of failing to reconnect. According java.net.http.HttpConnection.getConnectionImpl(xxx), it will try to get pooled connection if exists. But the pooled connection never got removed during closing connection. So the next attempt to connect will get the same connection which has been closed.

    JDK Bug System | 3 months ago | Felix Yang
    java.util.concurrent.ExecutionException: java.io.IOException: Connection closed at java.util.concurrent.CompletableFuture.reportGet(java.base@9-internal/CompletableFuture.java:395) at java.util.concurrent.CompletableFuture.get(java.base@9-internal/CompletableFuture.java:1999)
  3. 0

    Applet permissions denied unpredictably

    Oracle Community | 10 years ago | 843807
    java.util.concurrent.ExecutionException: java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Docker: Connection refused: /127.0.0.1:12900

    GitHub | 2 years ago | anaion
    java.util.concurrent.ExecutionException: java.net.ConnectException: Connection refused: /127.0.0.1:12900 to http://127.0.0.1:12900/system/cluster/node 2015-03-04_13:56:15.04154 at com.ning.http.client.providers.netty.NettyResponseFuture.abort(NettyResponseFuture.java:342) ~[com.ning.async-http-client-1.8.14.jar:na]
  6. 0

    [jira] [Updated] (SPARK-9255) SQL codegen fails with "value < is not a member of TimestampType.this.InternalType"

    mail-archive.com | 1 year ago
    java.util.concurrent.ExecutionException: scala.tools.reflect.ToolBoxError: reflective compilation has failed: value < is not a member of TimestampType.this.InternalType at org.spark-project.guava.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:306) at org.spark-project.guava.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:293) at org.spark-project.guava.util.concurrent.AbstractFuture.get(AbstractFuture.java:116) at org.spark-project.guava.util.concurrent.Uninterruptibles.getUninterruptibly(Uninterruptibles.java:135) at org.spark-project.guava.cache.LocalCache$Segment.getAndRecordStats(LocalCache.java:2410) at org.spark-project.guava.cache.LocalCache$Segment.loadSync(LocalCache.java:2380) at org.spark-project.guava.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2342) at org.spark-project.guava.cache.LocalCache$Segment.get(LocalCache.java:2257) at org.spark-project.guava.cache.LocalCache.get(LocalCache.java:4000) at org.spark-project.guava.cache.LocalCache.getOrLoad(LocalCache.java:4004) at org.spark-project.guava.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4874) at org.apache.spark.sql.catalyst.expressions.codegen.CodeGenerator.generate(CodeGenerator.scala:105) at org.apache.spark.sql.catalyst.expressions.codegen.CodeGenerator.generate(CodeGenerator.scala:102) at org.apache.spark.sql.execution.SparkPlan.newMutableProjection(SparkPlan.scala:170) at org.apache.spark.sql.execution.GeneratedAggregate$$anonfun$9.apply(GeneratedAggregate.scala:261) at org.apache.spark.sql.execution.GeneratedAggregate$$anonfun$9.apply(GeneratedAggregate.scala:246) at org.apache.spark.rdd.RDD$$anonfun$mapPartitions$1$$anonfun$apply$17.apply(RDD.scala:686) at org.apache.spark.rdd.RDD$$anonfun$mapPartitions$1$$anonfun$apply$17.apply(RDD.scala:686) at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:35)

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.util.concurrent.ExecutionException

      java.security.AccessControlException: access denied ("java.net.SocketPermission" "127.0.0.1:45470" "connect,resolve") at java.util.concurrent.CompletableFuture.reportGet(java.base@9-internal/CompletableFuture.java:395) at java.util.concurrent.CompletableFuture.get(java.base@9-internal/CompletableFuture.java:1999)

      at WSPermissionTest.lambda$urlPermissionTest$6()
    2. Unknown
      WSPermissionTest.lambda$urlPermissionTest$6
      1. WSPermissionTest.lambda$urlPermissionTest$6(WSPermissionTest.java:196)
      1 frame