{"action":"created","issue":{"url":"https://api.github.com/repos/raphw/byte-buddy/issues/581","repository_url":"https://api.github.com/repos/raphw/byte-buddy","labels_url":"https://api.github.com/repos/raphw/byte-buddy/issues/581/labels{/name}","comments_url":"https://api.github.com/repos/raphw/byte-buddy/issues/581/comments","events_url":"https://api.github.com/repos/raphw/byte-buddy/issues/581/events","html_url":"https://github.com/raphw/byte-buddy/issues/581","id":395968134,"node_id":"MDU6SXNzdWUzOTU5NjgxMzQ=","number":581,"title":"Creating JAR at runtime for appendToBootstrapClassLoaderSearch","user":{"login":"ndrez93","id":18165536,"node_id":"MDQ6VXNlcjE4MTY1NTM2","avatar_url":"https://avatars3.githubusercontent.com/u/18165536?v=4","gravatar_id":"","url":"https://api.github.com/users/ndrez93","html_url":"https://github.com/ndrez93","followers_url":"https://api.github.com/users/ndrez93/followers","following_url":"https://api.github.com/users/ndrez93/following{/other_user}","gists_url":"https://api.github.com/users/ndrez93/gists{/gist_id}","starred_url":"https://api.github.com/users/ndrez93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndrez93/subscriptions","organizations_url":"https://api.github.com/users/ndrez93/orgs","repos_url":"https://api.github.com/users/ndrez93/repos","events_url":"https://api.github.com/users/ndrez93/events{/privacy}","received_events_url":"https://api.github.com/users/ndrez93/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2019-01-04T15:37:30Z","updated_at":"2019-01-05T13:16:29Z","closed_at":null,"author_association":"NONE","body":"Hey,\r\n\r\nI'm attempting to override some java.lang.*-specific behavior that to my understanding requires a JAR file with custom functionality to be created. When I create the archive manually and include its path when setting up my Byte Buddy instance, it seems to work.\r\nHowever, am I correct that `AgentBuilder#enableBootstrapInjection` should provide this functionality out of the box? Tracing the code leads me to believe that it should create the JAR and include it in bootstrap class loader search.\r\nYet if I include this in my agent builder configuration, nothing seems to happen. While transformation succeeds, the JAR does not get generated and the substituted class is obviously not found. Debugging `enableBootstrapInjection` shows that the relevant methods are not even called. What could be missing here?\r\n\r\nMinimal (non-) working example:\r\n\r\n```\r\nvar i = ByteBuddyAgent.install();\r\n// JAR with Stub.class\r\ni.appendToBootstrapClassLoaderSearch(new JarFile(\"/some/file.jar\")); // <- DON'T WANT THIS\r\nvar classFileTransformer = new AgentBuilder.Default()\r\n\t.with(AgentBuilder.RedefinitionStrategy.REDEFINITION)\r\n\t.ignore(none())\r\n\t.enableBootstrapInjection(i, FileUtils.getTempDirectory()) // <- SHOULDN'T THIS REPLACE appendToBootstrapClassLoaderSearch?\r\n\t.type(ElementMatchers.is(System.class))\r\n\t.transform((b, c, d, e) -> b.method(ElementMatchers.named(\"methodToOverride\"))\r\n\t\t\t.intercept(MethodDelegation.to(Stub.class)))\r\n\t.installOn(i);\r\n```"},"comment":{"url":"https://api.github.com/repos/raphw/byte-buddy/issues/comments/451654543","html_url":"https://github.com/raphw/byte-buddy/issues/581#issuecomment-451654543","issue_url":"https://api.github.com/repos/raphw/byte-buddy/issues/581","id":451654543,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTY1NDU0Mw==","user":{"login":"paplorinc","id":1841944,"node_id":"MDQ6VXNlcjE4NDE5NDQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1841944?v=4","gravatar_id":"","url":"https://api.github.com/users/paplorinc","html_url":"https://github.com/paplorinc","followers_url":"https://api.github.com/users/paplorinc/followers","following_url":"https://api.github.com/users/paplorinc/following{/other_user}","gists_url":"https://api.github.com/users/paplorinc/gists{/gist_id}","starred_url":"https://api.github.com/users/paplorinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paplorinc/subscriptions","organizations_url":"https://api.github.com/users/paplorinc/orgs","repos_url":"https://api.github.com/users/paplorinc/repos","events_url":"https://api.github.com/users/paplorinc/events{/privacy}","received_events_url":"https://api.github.com/users/paplorinc/received_events","type":"User","site_admin":false},"created_at":"2019-01-05T13:16:29Z","updated_at":"2019-01-05T13:16:29Z","author_association":"NONE","body":"Seems to be related to my question: https://github.com/raphw/byte-buddy/issues/577#issuecomment-450671944"}}
{"actor":{"display_login":"paplorinc"}}