From f3f6cf25122bf809e34b96071c0fc41590ef278e Mon Sep 17 00:00:00 2001 From: Sebastian Wollner Date: Wed, 3 Jul 2024 13:16:58 +0200 Subject: [PATCH 1/2] fix: JobHandler throws ClassNotFoundException when updating by RefreshScope in cluster context --- .../server/jobs/quartz/JobHandler.java | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/Backend/services/core/src/main/java/org/edu_sharing/repository/server/jobs/quartz/JobHandler.java b/Backend/services/core/src/main/java/org/edu_sharing/repository/server/jobs/quartz/JobHandler.java index 33dbd90f2..f266ecd24 100644 --- a/Backend/services/core/src/main/java/org/edu_sharing/repository/server/jobs/quartz/JobHandler.java +++ b/Backend/services/core/src/main/java/org/edu_sharing/repository/server/jobs/quartz/JobHandler.java @@ -3,37 +3,36 @@ */ package org.edu_sharing.repository.server.jobs.quartz; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.text.ParseException; -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; -import java.util.stream.Collectors; - import com.typesafe.config.Config; import com.typesafe.config.ConfigValue; import net.sf.acegisecurity.AuthenticationCredentialsNotFoundException; - import org.alfresco.service.ServiceRegistry; import org.apache.log4j.Logger; -import org.edu_sharing.alfrescocontext.gate.AlfAppContextGate; import org.edu_sharing.alfresco.lightbend.LightbendConfigLoader; +import org.edu_sharing.alfrescocontext.gate.AlfAppContextGate; import org.edu_sharing.spring.scope.refresh.RefreshScopeRefreshedEvent; import org.jetbrains.annotations.NotNull; import org.quartz.*; import org.quartz.impl.JobDetailImpl; import org.quartz.impl.matchers.GroupMatcher; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationListener; import org.springframework.scheduling.quartz.SchedulerFactoryBean; import org.springframework.stereotype.Component; -import org.springframework.context.ApplicationContext; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.text.ParseException; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; +import static org.quartz.CronScheduleBuilder.cronSchedule; +import static org.quartz.CronScheduleBuilder.dailyAtHourAndMinute; import static org.quartz.JobBuilder.newJob; import static org.quartz.SimpleScheduleBuilder.simpleSchedule; import static org.quartz.TriggerBuilder.newTrigger; -import static org.quartz.CronScheduleBuilder.*; /** * @author rudi start jobs, start scheduling of an job, stop scheduling of a job @@ -432,7 +431,7 @@ public synchronized void refresh(boolean triggerImmediateJobs) { } logger.info("primary repository, will register and handle quartz jobs"); - ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); + ClassLoader classLoader = this.getClass().getClassLoader(); List list = LightbendConfigLoader.get().getConfigList("jobs.entries"); jobConfigList.clear(); for (String groupName : quartzScheduler.getJobGroupNames()) { From fa9ac1d96f2860c9179ae348c92d394851d008fb Mon Sep 17 00:00:00 2001 From: Torsten Simon Date: Wed, 3 Jul 2024 17:05:55 +0200 Subject: [PATCH 2/2] fix:missing bean definition causing nlp of nodeService while tracking --- .../main/resources/org/edu_sharing/spring/base-services.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Backend/services/core/src/main/resources/org/edu_sharing/spring/base-services.xml b/Backend/services/core/src/main/resources/org/edu_sharing/spring/base-services.xml index 0983d6606..05831d848 100644 --- a/Backend/services/core/src/main/resources/org/edu_sharing/spring/base-services.xml +++ b/Backend/services/core/src/main/resources/org/edu_sharing/spring/base-services.xml @@ -52,6 +52,11 @@ + + + + +