Commit 7463406
authored
Use class' class loader when looking up
Prior to this change, `HttpClient.Factory.create` was using
`ServiceLoader.load` without passing in a class loader explicitly. In
this case, `ServiceLoader` is using the current thread's default class
loader to resolve the specified class name's service.
In projects with a plugin system, this can lead to problems, when
selenium dependencies are part of a jar file that is not on the class
path the application was started with. For these projects, using
selenium results in a `ClassNotFoundException` when the first remote
call is performed.
To fix this, using the class loader of the factory interface would be
beneficial. In projects without a plugin architecture, it will mostly be
identical with the class loader of the current thread, in other cases
there is very high chance that the service which is to be loaded can be
resolved through the class loader of `HttpClient.Factory`.HttpClient factory. (#10232)1 parent 3ef95ef commit 7463406
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
0 commit comments