Browse Source

REPORT-71790 【win11适配】FR11启动失败,报错npe

new-design
hades 2 years ago
parent
commit
4d89583adb
  1. 38
      designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java

38
designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java

@ -158,26 +158,26 @@ public class DesignerStartup extends Activator {
private void registerDaoSelector() { private void registerDaoSelector() {
// 注入设计器db cache 是否可用 // 注入设计器db cache 是否可用
DesignerWorkspaceInfo info = WorkspaceUtils.getWorkspaceInfo();
if (info.getType() == DesignerWorkspaceType.Remote) {
DaoSelectorFactory.registerDaoSelector(() -> false); DaoSelectorFactory.registerDaoSelector(() -> false);
} else { // DesignerWorkspaceInfo info = WorkspaceUtils.getWorkspaceInfo();
String webInfPath = WorkspaceUtils.getWorkspaceInfo().getPath(); // if (info.getType() == DesignerWorkspaceType.Remote) {
String dbConfigPath = StableUtils.pathJoin(webInfPath, ProjectConstants.CONFIG_DIRECTORY, // } else {
EncryptionConstants.PROPERTY_NAME); // String webInfPath = WorkspaceUtils.getWorkspaceInfo().getPath();
String entityPath = generatePath(webInfPath, PropertiesConstants.ENTITY_PROP); // String dbConfigPath = StableUtils.pathJoin(webInfPath, ProjectConstants.CONFIG_DIRECTORY,
String xmlEntityPath = generatePath(webInfPath, PropertiesConstants.XML_ENTITY_PROP); // EncryptionConstants.PROPERTY_NAME);
String classNamePath = generatePath(webInfPath, PropertiesConstants.CLASS_NAME_PROP); // String entityPath = generatePath(webInfPath, PropertiesConstants.ENTITY_PROP);
// 校验 平台迁移文件/缓存文件 // String xmlEntityPath = generatePath(webInfPath, PropertiesConstants.XML_ENTITY_PROP);
boolean existPropCache = new File(entityPath).exists() && new File(xmlEntityPath).exists() && new File(classNamePath).exists(); // String classNamePath = generatePath(webInfPath, PropertiesConstants.CLASS_NAME_PROP);
DaoSelectorFactory.registerDaoSelector(() -> DesignerEnvManager.getEnvManager().isPropertiesUsable() // // 校验 平台迁移文件/缓存文件
&& OptimizeUtil.isOpen() // boolean existPropCache = new File(entityPath).exists() && new File(xmlEntityPath).exists() && new File(classNamePath).exists();
&& existPropCache // DaoSelectorFactory.registerDaoSelector(() -> DesignerEnvManager.getEnvManager().isPropertiesUsable()
// demo启动时 前后目录可能会不一致 造成读取缓存失败 // && OptimizeUtil.isOpen()
&& !startupArgsValue.getValue().isDemo() // && existPropCache
&& !new File(dbConfigPath).exists()); // // demo启动时 前后目录可能会不一致 造成读取缓存失败
// && !startupArgsValue.getValue().isDemo()
} // && !new File(dbConfigPath).exists());
//
// }
} }
private String generatePath(String webInfPath, String name) { private String generatePath(String webInfPath, String name) {

Loading…
Cancel
Save