Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jans-core): inherit context classloader #8952 #8953

Merged
merged 2 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ org.quartz.scheduler.instanceName=Jans AuthScheduler
org.quartz.threadPool.threadCount=8
org.quartz.jobStore.class=org.quartz.simpl.RAMJobStore
org.quartz.scheduler.skipUpdateCheck=true
org.quartz.scheduler.threadsInheritContextClassLoaderOfInitializer=true
1 change: 1 addition & 0 deletions jans-casa/app/src/main/resources/quartz.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ org.quartz.scheduler.instanceName=casaScheduler
org.quartz.threadPool.threadCount=5
org.quartz.jobStore.class=org.quartz.simpl.RAMJobStore
org.quartz.scheduler.skipUpdateCheck=true
org.quartz.scheduler.threadsInheritContextClassLoaderOfInitializer=true
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ org.quartz.scheduler.instanceName=JansConfigScheduler
org.quartz.threadPool.threadCount=5
org.quartz.jobStore.class=org.quartz.simpl.RAMJobStore
org.quartz.scheduler.skipUpdateCheck=true
org.quartz.scheduler.threadsInheritContextClassLoaderOfInitializer=true
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ org.quartz.scheduler.instanceName=JansConfigScheduler
org.quartz.threadPool.threadCount=5
org.quartz.jobStore.class=org.quartz.simpl.RAMJobStore
org.quartz.scheduler.skipUpdateCheck=true
org.quartz.scheduler.threadsInheritContextClassLoaderOfInitializer=true
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,17 @@ public Object invoke(InvocationContext ctx) throws Exception {
return CompletableFuture.supplyAsync(new Supplier<Object>() {
@Override
public Object get() {
// Inherit context class loader
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
try {
ASYNC_INVOCATION.set(Boolean.TRUE);
return localCtx.proceed();
} catch (Exception ex) {
ex.printStackTrace();
} finally {
// Restore context class loader
Thread.currentThread().setContextClassLoader(oldClassLoader);
ASYNC_INVOCATION.remove();
}

Expand Down
1 change: 1 addition & 0 deletions jans-fido2/server/src/main/resources/quartz.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ org.quartz.scheduler.instanceName=Fido2Scheduler
org.quartz.threadPool.threadCount=5
org.quartz.jobStore.class=org.quartz.simpl.RAMJobStore
org.quartz.scheduler.skipUpdateCheck=true
org.quartz.scheduler.threadsInheritContextClassLoaderOfInitializer=true
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ org.quartz.scheduler.instanceName=JansConfigScheduler
org.quartz.threadPool.threadCount=5
org.quartz.jobStore.class=org.quartz.simpl.RAMJobStore
org.quartz.scheduler.skipUpdateCheck=true
org.quartz.scheduler.threadsInheritContextClassLoaderOfInitializer=true
1 change: 1 addition & 0 deletions jans-link/server/src/main/resources/quartz.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ org.quartz.scheduler.instanceName=JansConfigScheduler
org.quartz.threadPool.threadCount=5
org.quartz.jobStore.class=org.quartz.simpl.RAMJobStore
org.quartz.scheduler.skipUpdateCheck=true
org.quartz.scheduler.threadsInheritContextClassLoaderOfInitializer=true
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ org.quartz.scheduler.instanceName=JansConfigScheduler
org.quartz.threadPool.threadCount=5
org.quartz.jobStore.class=org.quartz.simpl.RAMJobStore
org.quartz.scheduler.skipUpdateCheck=true
org.quartz.scheduler.threadsInheritContextClassLoaderOfInitializer=true
org.quartz.scheduler.threadsInheritContextClassLoaderOfInitializer=true
1 change: 1 addition & 0 deletions jans-scim/server/src/main/resources/quartz.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ org.quartz.scheduler.instanceName=oxTrustScheduler
org.quartz.threadPool.threadCount=5
org.quartz.jobStore.class=org.quartz.simpl.RAMJobStore
org.quartz.scheduler.skipUpdateCheck=true
org.quartz.scheduler.threadsInheritContextClassLoaderOfInitializer=true