We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dddd031 commit 64ceb19Copy full SHA for 64ceb19
jetcache-core/src/main/java/com/alicp/jetcache/support/JetCacheExecutor.java
@@ -43,6 +43,15 @@ public static ScheduledExecutorService defaultExecutor() {
43
ThreadFactory tf = r -> {
44
Thread t = new Thread(r, "JetCacheDefaultExecutor");
45
t.setDaemon(true);
46
+
47
+ ClassLoader classLoader = JetCacheExecutor.class.getClassLoader();
48
+ if (classLoader == null) {
49
+ // This class was loaded by the Bootstrap ClassLoader,
50
+ // so let's tie the thread's context ClassLoader to the System ClassLoader instead.
51
+ classLoader = ClassLoader.getSystemClassLoader();
52
+ }
53
+ t.setContextClassLoader(classLoader);
54
55
return t;
56
};
57
int coreSize = Math.min(4, Runtime.getRuntime().availableProcessors());
0 commit comments