From d40e743be98adeede4f994f7c51c26ccbff9931d Mon Sep 17 00:00:00 2001 From: smallchill Date: Thu, 27 Dec 2018 09:17:17 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/springblade/core/tool/utils/SpringUtil.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/SpringUtil.java b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/SpringUtil.java index a677189..0d746a3 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/SpringUtil.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/SpringUtil.java @@ -15,6 +15,7 @@ */ package org.springblade.core.tool.utils; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; @@ -23,6 +24,7 @@ import org.springframework.context.ApplicationEvent; /** * spring 工具类 */ +@Slf4j public class SpringUtil implements ApplicationContextAware { private static ApplicationContext context; @@ -61,7 +63,11 @@ public class SpringUtil implements ApplicationContextAware { public static void publishEvent(ApplicationEvent event) { if (context == null) return; - context.publishEvent(event); + try { + context.publishEvent(event); + } catch (Exception ex) { + log.error(ex.getMessage()); + } } }