{"action":"created","issue":{"url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/362","labels_url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/362/labels{/name}","comments_url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/362/comments","events_url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/362/events","html_url":"https://github.com/asciidoctor/asciidoctorj/issues/362","id":95915533,"number":362,"title":"Verify resource loading with JRuby 9.0.0.0","user":{"login":"robertpanzer","id":1163662,"avatar_url":"https://avatars.githubusercontent.com/u/1163662?v=3","gravatar_id":"","url":"https://api.github.com/users/robertpanzer","html_url":"https://github.com/robertpanzer","followers_url":"https://api.github.com/users/robertpanzer/followers","following_url":"https://api.github.com/users/robertpanzer/following{/other_user}","gists_url":"https://api.github.com/users/robertpanzer/gists{/gist_id}","starred_url":"https://api.github.com/users/robertpanzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertpanzer/subscriptions","organizations_url":"https://api.github.com/users/robertpanzer/orgs","repos_url":"https://api.github.com/users/robertpanzer/repos","events_url":"https://api.github.com/users/robertpanzer/events{/privacy}","received_events_url":"https://api.github.com/users/robertpanzer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-07-19T13:25:39Z","updated_at":"2015-07-21T21:23:17Z","closed_at":null,"body":"JRuby 1.7 by default uses the TCCL to load resources from Jars like the asciidoctor gem.\r\nAs converter and extension registry service implementation are also found via the TCCL we changed our recommendation to setup the Asciidoctor instance without passing a ClassLoader to `Asciidoctor.Factory.create()` but set the TCCL appropriately before invocation of the `create()` method.\r\n\r\nJRuby 9.0.0.0 changed this default as you can see in https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/RubyInstanceConfig.java#L1397-L1407\r\nInstead of the TCCL the default loader is the ClassLoader that loaded the `jruby.jar` or the class `RubyInstanceConfig` respectively. The TCCL is only a fallback if this class is loaded via the boot class loader, which would mean to place the `jruby.jar` into `<jre-home>/lib`.\r\nThis change in behavior also becomes apparent in the test `WhenClassloaderIsRequired` which fails with JRuby 9.0.0.0.\r\n\r\n\r\nSo tools like the ant task or the SBT plugin would have to pass a class loader again, what we just removed. (And I think it's quite strange to pass in the class loader that loaded Asciidoctor to the create method, `Asciidoctor.Factory.create()` should know which Classloader loaded it;-) )\r\n\r\nAs a solution I would recommend to let AsciidoctorJ pass the TCCL to `RubyInstanceConfig.setLoader()` if no other class loader is passed to `Asciidoctor.Factory.create()`.\r\nWhat do you think?"},"comment":{"url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/comments/123481999","html_url":"https://github.com/asciidoctor/asciidoctorj/issues/362#issuecomment-123481999","issue_url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/362","id":123481999,"user":{"login":"mojavelinux","id":79351,"avatar_url":"https://avatars.githubusercontent.com/u/79351?v=3","gravatar_id":"","url":"https://api.github.com/users/mojavelinux","html_url":"https://github.com/mojavelinux","followers_url":"https://api.github.com/users/mojavelinux/followers","following_url":"https://api.github.com/users/mojavelinux/following{/other_user}","gists_url":"https://api.github.com/users/mojavelinux/gists{/gist_id}","starred_url":"https://api.github.com/users/mojavelinux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mojavelinux/subscriptions","organizations_url":"https://api.github.com/users/mojavelinux/orgs","repos_url":"https://api.github.com/users/mojavelinux/repos","events_url":"https://api.github.com/users/mojavelinux/events{/privacy}","received_events_url":"https://api.github.com/users/mojavelinux/received_events","type":"User","site_admin":false},"created_at":"2015-07-21T21:23:17Z","updated_at":"2015-07-21T21:23:17Z","body":"Thanks @headius!"}}