{"action":"opened","issue":{"url":"https://api.github.com/repos/oracle/graal/issues/357","repository_url":"https://api.github.com/repos/oracle/graal","labels_url":"https://api.github.com/repos/oracle/graal/issues/357/labels{/name}","comments_url":"https://api.github.com/repos/oracle/graal/issues/357/comments","events_url":"https://api.github.com/repos/oracle/graal/issues/357/events","html_url":"https://github.com/oracle/graal/issues/357","id":316269674,"number":357,"title":"Can't use HttpURLConnection due to reflection","user":{"login":"lbialy","id":8607442,"avatar_url":"https://avatars1.githubusercontent.com/u/8607442?v=4","gravatar_id":"","url":"https://api.github.com/users/lbialy","html_url":"https://github.com/lbialy","followers_url":"https://api.github.com/users/lbialy/followers","following_url":"https://api.github.com/users/lbialy/following{/other_user}","gists_url":"https://api.github.com/users/lbialy/gists{/gist_id}","starred_url":"https://api.github.com/users/lbialy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbialy/subscriptions","organizations_url":"https://api.github.com/users/lbialy/orgs","repos_url":"https://api.github.com/users/lbialy/repos","events_url":"https://api.github.com/users/lbialy/events{/privacy}","received_events_url":"https://api.github.com/users/lbialy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-20T13:33:18Z","updated_at":"2018-04-20T13:33:18Z","closed_at":null,"author_association":"NONE","body":"A trivial example using `scalaj-http` library (a wrapper for HttpURLConnection) crashes in runtime when compiled to native binary with `native-image` tool. Here's a stack trace:\r\n```\r\njava.lang.AssertionError: Should not here\r\n\tat java.lang.Throwable.<init>(Throwable.java:265)\r\n\tat java.lang.Error.<init>(Error.java:70)\r\n\tat java.lang.AssertionError.<init>(AssertionError.java:58)\r\n\tat java.lang.AssertionError.<init>(AssertionError.java:74)\r\n\tat sun.util.logging.LoggingSupport.ensureAvailable(LoggingSupport.java:76)\r\n\tat sun.util.logging.LoggingSupport.isLoggable(LoggingSupport.java:114)\r\n\tat sun.util.logging.PlatformLogger$JavaLoggerProxy.isLoggable(PlatformLogger.java:656)\r\n\tat sun.util.logging.PlatformLogger.isLoggable(PlatformLogger.java:270)\r\n\tat sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1147)\r\n\tat sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)\r\n\tat sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)\r\n\tat scalaj.http.DefaultConnectFunc$.apply(Http.scala:471)\r\n\tat scalaj.http.DefaultConnectFunc$.apply(Http.scala:469)\r\n\tat scalaj.http.HttpRequest.doConnection(Http.scala:355)\r\n\tat scalaj.http.HttpRequest.exec(Http.scala:335)\r\n\tat scalaj.http.HttpRequest.asString(Http.scala:455)\r\n```\r\nThat assertion is a null check for this field in `sun.util.logging.LoggingSupport`:\r\n```\r\n    private static final LoggingProxy proxy = (LoggingProxy)AccessController.doPrivileged(new PrivilegedAction<LoggingProxy>() {\r\n        public LoggingProxy run() {\r\n            try {\r\n                Class var1 = Class.forName(\"java.util.logging.LoggingProxyImpl\", true, (ClassLoader)null);\r\n                Field var2 = var1.getDeclaredField(\"INSTANCE\");\r\n                var2.setAccessible(true);\r\n                return (LoggingProxy)var2.get((Object)null);\r\n            } catch (ClassNotFoundException var3) {\r\n                return null;\r\n            } catch (NoSuchFieldException var4) {\r\n                throw new AssertionError(var4);\r\n            } catch (IllegalAccessException var5) {\r\n                throw new AssertionError(var5);\r\n            }\r\n        }\r\n    });\r\n```\r\n\r\nI assume that `Class.forName` doesn't work and ClassNotFoundException is thrown, which results in `proxy` field being set to null."}}
{"actor":{"display_login":"lbialy"}}