diff --git a/designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java b/designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java index 47b67e6463..f8a4cc6739 100644 --- a/designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java +++ b/designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java @@ -3,6 +3,7 @@ package com.fr.design.env; import com.fanruan.workplace.http.HttpConstants; import com.fanruan.workplace.http.HttpServiceMap; import com.fanruan.workplace.http.RepositoryManager; +import com.fanruan.workplace.http.exception.RemoteServiceErrorException; import com.fanruan.workplace.http.info.Stub; import com.fanruan.workplace.network.RemoteNetworkRepository; import com.fr.decision.webservice.bean.authentication.LoginRequestInfoBean; @@ -86,7 +87,7 @@ public class HttpWorkspaceConnector implements WorkspaceConnector { client.setTimeout(timeout); try { return RemoteNetworkRepository.getInstance().testConnect(); - } catch (RemoteDesignNoAuthException e) { + } catch (RemoteDesignNoAuthException | RemoteServiceErrorException e) { throw e; } catch (Exception e) { throw new RemoteDesignConnectionException(e, StringUtils.EMPTY); diff --git a/designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java b/designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java index 985bcc8e22..ebf1bf57e6 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java +++ b/designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java @@ -1,10 +1,13 @@ package com.fanruan.boot.adaptation; -import com.fanruan.carina.Carina; -import com.fanruan.carina.context.ContextListener; +import com.fanruan.carina.event.CarinaLifecycleEvent; import com.fanruan.portal.authority.PortalAuthorityItems; import com.fanruan.portal.module.PortalModule; import com.fanruan.portal.module.PortalModuleManager; +import com.fr.event.Event; +import com.fr.event.EventDispatcher; +import com.fr.event.Listener; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import com.fr.third.guava.collect.Sets; @@ -94,14 +97,17 @@ public class DesignServerSupportModule { * 启动入口,重建一下展示的module */ public static void rebuild() { - Carina.getApplicationContext().addListener(new ContextListener() { + + EventDispatcher.listen(CarinaLifecycleEvent.AFTER_START, new Listener() { @Override - public void onStart() { + public void on(Event event, Object o) { + FineLoggerFactory.getLogger().info("start unregister module for embed design server"); PortalModuleManager.allModules().values().stream() .filter(m -> !StringUtils.equals(m.getParentID(), PortalAuthorityItems.PORTAL_ROOT_ID)) .map(PortalModule::getId) .filter(m -> !SUPPORT_MODULE.contains(m)) .forEach(PortalModuleManager::unregister); + FineLoggerFactory.getLogger().info("unregister module for embed design server done"); } }); } diff --git a/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignComponent.java b/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignComponent.java index 06fe5526a2..297d3950f0 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignComponent.java @@ -17,15 +17,12 @@ import com.fr.base.process.ProcessOperator; import com.fr.base.theme.migrator.FormThemeConfigMigrator; import com.fr.base.theme.migrator.ReportThemeConfigMigrator; import com.fr.chart.chartattr.ChartCollection; -import com.fr.config.ServerPreferenceConfig; -import com.fr.data.core.db.dml.Update; import com.fr.decision.update.backup.RecoverManager; import com.fr.decision.webservice.v10.plugin.helper.category.impl.PluginResourceLoader; import com.fr.decision.webservice.v10.plugin.helper.category.impl.UpmResourceLoader; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.RPCConnectHandlerCenter; -import com.fr.design.actions.NewFormAction; import com.fr.design.actions.UpdateAction; import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.insert.cell.BiasCellAction; @@ -128,7 +125,6 @@ import com.fr.quickeditor.cellquick.CellImageQuickEditor; import com.fr.quickeditor.cellquick.CellRichTextEditor; import com.fr.quickeditor.cellquick.CellStringQuickEditor; import com.fr.quickeditor.cellquick.CellSubReportEditor; -import com.fr.quickeditor.chartquick.BasicChartQuickEditor; import com.fr.quickeditor.chartquick.FloatChartQuickEditor; import com.fr.quickeditor.floatquick.FloatImageQuickEditor; import com.fr.quickeditor.floatquick.FloatStringQuickEditor; @@ -141,7 +137,6 @@ import com.fr.report.cell.painter.CellImagePainter; import com.fr.stable.ArrayUtils; import com.fr.stable.ParameterProvider; import com.fr.stable.bridge.StableFactory; -import com.fr.stable.os.support.OSBasedAction; import com.fr.stable.os.support.OSSupportCenter; import com.fr.stable.plugin.ExtraDesignClassManagerProvider; import com.fr.stable.script.CalculatorProviderContext; @@ -149,7 +144,6 @@ import com.fr.stable.script.ValueConverter; import com.fr.stable.xml.ObjectTokenizer; import com.fr.stable.xml.ObjectXMLWriterFinder; import com.fr.start.BBSGuestPaneProvider; -import com.fr.start.common.DesignerStartupExecutor; import com.fr.start.common.DesignerStartupPool; import com.fr.task.Once; import com.fr.workspace.WorkContext; @@ -198,8 +192,10 @@ public class DesignComponent { } } CompletableFuture themeConfigPrepare = CompletableFuture.runAsync(() -> { - FormThemeConfigMigrator.getInstance().upgrade(); - ReportThemeConfigMigrator.getInstance().upgrade(); + if (WorkContext.getCurrent().isLocal()) { + FormThemeConfigMigrator.getInstance().upgrade(); + ReportThemeConfigMigrator.getInstance().upgrade(); + } }, DesignerStartupPool.common()); CompletableFuture mainDesignerPrepare = CompletableFuture.runAsync(this::designerModuleStart, DesignerStartupPool.common()); CompletableFuture extendDesignerPrepare = CompletableFuture.runAsync(this::designerExtendStart, DesignerStartupPool.common()); diff --git a/designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java b/designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java index 198f543bb8..aadc05ce1c 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java @@ -15,6 +15,7 @@ import com.fanruan.workplace.http.RepositoryManager; import com.fanruan.workplace.http.WorkspaceHeartBeatShell; import com.fanruan.workplace.http.exception.DefaultRemoteExceptionHandler; import com.fanruan.workplace.http.exception.RemoteExceptionConvert; +import com.fanruan.workplace.http.exception.RemoteServiceErrorExceptionHandler; import com.fanruan.workplace.network.RemoteNetworkRepository; import com.fanruan.workplace.standard.ServerInfo; import com.fanruan.workplace.standard.ServerInfoOperator; @@ -162,6 +163,7 @@ public class DesignWorkContextComponent { RemoteExceptionConvert.registerException(HttpConstants.LOGIN_LOCK, new RemoteDesignLoginLockHandler()); RemoteExceptionConvert.registerException(HttpConstants.TPL_HAS_BEAN_UNLOCK, new UnLockedHandler()); RemoteExceptionConvert.registerException(HttpConstants.DRIVER_NOT_EXIST, new RemoteDriverUnExistHandler()); + RemoteExceptionConvert.registerException(HttpConstants.SERVICE_ERROR, new RemoteServiceErrorExceptionHandler()); DefaultRemoteExceptionHandler.getInstance().registerMatchMsg(ERROR_CODE, new RemoteProcedureErrorHandler()); }