Skip to content

Commit

Permalink
Use correct classloader before initialising Jira REST client. (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
markawm authored Jun 25, 2021
1 parent 0c790df commit 5caf008
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/hudson/plugins/jira/JiraSite.java
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,14 @@ public static class ExtendedAsynchronousJiraRestClientFactory implements JiraRes

public ExtendedJiraRestClient create(final URI serverUri, final AuthenticationHandler authenticationHandler, HttpClientOptions options) {
final DisposableHttpClient httpClient = createClient(serverUri, authenticationHandler, options);
return new ExtendedAsynchronousJiraRestClient( serverUri, httpClient);
Thread t = Thread.currentThread();
ClassLoader orig = t.getContextClassLoader();
t.setContextClassLoader(JiraSite.class.getClassLoader());
try {
return new ExtendedAsynchronousJiraRestClient(serverUri, httpClient);
} finally {
t.setContextClassLoader(orig);
}
}

@Override
Expand Down

0 comments on commit 5caf008

Please sign in to comment.