{"action":"created","issue":{"url":"https://api.github.com/repos/gradle/gradle/issues/2657","repository_url":"https://api.github.com/repos/gradle/gradle","labels_url":"https://api.github.com/repos/gradle/gradle/issues/2657/labels{/name}","comments_url":"https://api.github.com/repos/gradle/gradle/issues/2657/comments","events_url":"https://api.github.com/repos/gradle/gradle/issues/2657/events","html_url":"https://github.com/gradle/gradle/issues/2657","id":247952135,"node_id":"MDU6SXNzdWUyNDc5NTIxMzU=","number":2657,"title":"SLF4J ClassCastException when testing with custom system ClassLoader or Java 9 modules","user":{"login":"chrisr3","id":25174078,"node_id":"MDQ6VXNlcjI1MTc0MDc4","avatar_url":"https://avatars1.githubusercontent.com/u/25174078?v=4","gravatar_id":"","url":"https://api.github.com/users/chrisr3","html_url":"https://github.com/chrisr3","followers_url":"https://api.github.com/users/chrisr3/followers","following_url":"https://api.github.com/users/chrisr3/following{/other_user}","gists_url":"https://api.github.com/users/chrisr3/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisr3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisr3/subscriptions","organizations_url":"https://api.github.com/users/chrisr3/orgs","repos_url":"https://api.github.com/users/chrisr3/repos","events_url":"https://api.github.com/users/chrisr3/events{/privacy}","received_events_url":"https://api.github.com/users/chrisr3/received_events","type":"User","site_admin":false},"labels":[{"id":460356597,"node_id":"MDU6TGFiZWw0NjAzNTY1OTc=","url":"https://api.github.com/repos/gradle/gradle/labels/a:bug","name":"a:bug","color":"d93f0b","default":false},{"id":503799007,"node_id":"MDU6TGFiZWw1MDM3OTkwMDc=","url":"https://api.github.com/repos/gradle/gradle/labels/affects-version:3.4","name":"affects-version:3.4","color":"c5def5","default":false},{"id":478384995,"node_id":"MDU6TGFiZWw0NzgzODQ5OTU=","url":"https://api.github.com/repos/gradle/gradle/labels/from:contributor","name":"from:contributor","color":"0052cc","default":false},{"id":281288685,"node_id":"MDU6TGFiZWwyODEyODg2ODU=","url":"https://api.github.com/repos/gradle/gradle/labels/in:testing","name":"in:testing","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/gradle/gradle/milestones/59","html_url":"https://github.com/gradle/gradle/milestone/59","labels_url":"https://api.github.com/repos/gradle/gradle/milestones/59/labels","id":3014889,"node_id":"MDk6TWlsZXN0b25lMzAxNDg4OQ==","number":59,"title":"5.0 RC1","description":"","creator":{"login":"jjohannes","id":1963746,"node_id":"MDQ6VXNlcjE5NjM3NDY=","avatar_url":"https://avatars0.githubusercontent.com/u/1963746?v=4","gravatar_id":"","url":"https://api.github.com/users/jjohannes","html_url":"https://github.com/jjohannes","followers_url":"https://api.github.com/users/jjohannes/followers","following_url":"https://api.github.com/users/jjohannes/following{/other_user}","gists_url":"https://api.github.com/users/jjohannes/gists{/gist_id}","starred_url":"https://api.github.com/users/jjohannes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjohannes/subscriptions","organizations_url":"https://api.github.com/users/jjohannes/orgs","repos_url":"https://api.github.com/users/jjohannes/repos","events_url":"https://api.github.com/users/jjohannes/events{/privacy}","received_events_url":"https://api.github.com/users/jjohannes/received_events","type":"User","site_admin":false},"open_issues":74,"closed_issues":240,"state":"open","created_at":"2018-01-05T10:38:20Z","updated_at":"2018-09-21T21:05:14Z","due_on":"2018-10-02T07:00:00Z","closed_at":null},"comments":16,"created_at":"2017-08-04T09:29:52Z","updated_at":"2018-09-22T21:11:52Z","closed_at":null,"author_association":"NONE","body":"Setting ` java.system.class.loader` property breaks unit tests with Gradle >= 3.4.1 for any project that uses SLF4J. I've also reproduced this with Gradle 4.0.2, where the bug makes Gradle hang as well as fail.\r\n\r\n### Expected Behavior\r\nMy unit tests should run using the classloader specified by the `java.system.class.loader` property,\r\n\r\n### Current Behavior\r\nGradle fails with an exception like:\r\n```java\r\njava.lang.ClassCastException: org.slf4j.helpers.NOPLoggerFactory cannot be cast to org.gradle.internal.logging.slf4j.OutputEventListenerBackedLoggerContext\r\n        at org.gradle.internal.logging.slf4j.Slf4jLoggingConfigurer.configure(Slf4jLoggingConfigurer.java:42)\r\n        at org.gradle.internal.logging.config.LoggingSystemAdapter.startCapture(LoggingSystemAdapter.java:54)\r\n        at org.gradle.internal.logging.services.DefaultLoggingManager$StartableLoggingSystem.start(DefaultLoggingManager.java:297)\r\n        at org.gradle.internal.logging.services.DefaultLoggingManager.start(DefaultLoggingManager.java:73)\r\n        at org.gradle.internal.logging.services.DefaultLoggingManager.start(DefaultLoggingManager.java:37)\r\n        at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:65)\r\n        at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:46)\r\n        at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:62)\r\n        at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:67)\r\n:test FAILED\r\n```\r\nNote that my example project is using the NOP SLF4J implementation for simplicity only, \r\n### Context\r\n<!--- How has this issue affected you? What are you trying to accomplish? -->\r\n<!--- Providing context helps us come up with a solution that is most useful in the real world -->\r\n\r\n### Steps to Reproduce (for bugs)\r\nBasic sample project:\r\n[classloader.zip](https://github.com/gradle/gradle/files/1199825/classloader.zip)\r\n\r\n### Your Environment\r\nLinux x86_64, Oracle JDK 1.8.0_144 and OpenJDK 1.8.0_141.\r\n\r\n[Build Scan](https://scans.gradle.com/s/3bmf2vuduv6pm)\r\n"},"comment":{"url":"https://api.github.com/repos/gradle/gradle/issues/comments/423773784","html_url":"https://github.com/gradle/gradle/issues/2657#issuecomment-423773784","issue_url":"https://api.github.com/repos/gradle/gradle/issues/2657","id":423773784,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzc3Mzc4NA==","user":{"login":"jmalyik","id":6026113,"node_id":"MDQ6VXNlcjYwMjYxMTM=","avatar_url":"https://avatars0.githubusercontent.com/u/6026113?v=4","gravatar_id":"","url":"https://api.github.com/users/jmalyik","html_url":"https://github.com/jmalyik","followers_url":"https://api.github.com/users/jmalyik/followers","following_url":"https://api.github.com/users/jmalyik/following{/other_user}","gists_url":"https://api.github.com/users/jmalyik/gists{/gist_id}","starred_url":"https://api.github.com/users/jmalyik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmalyik/subscriptions","organizations_url":"https://api.github.com/users/jmalyik/orgs","repos_url":"https://api.github.com/users/jmalyik/repos","events_url":"https://api.github.com/users/jmalyik/events{/privacy}","received_events_url":"https://api.github.com/users/jmalyik/received_events","type":"User","site_admin":false},"created_at":"2018-09-22T21:11:52Z","updated_at":"2018-09-22T21:11:52Z","author_association":"NONE","body":"A simple workaround can be to provide the OutputEventListenerBackedLoggerContext class as testCompile dependency. Unfortunately you have to reference the right jars from the gradle binaries. A bit ugly and will not work for all the cases, but more than nothing.\r\nI made a [fork](https://github.com/jmalyik/bootstrap-test) from @dimitarg's project.\r\n"}}
{"actor":{"display_login":"jmalyik"}}