From 29b64b7d51a94012ae732db5bbf34be2416ffc55 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Tue, 26 Oct 2010 18:58:04 +0800 Subject: [PATCH] Don't continue platform startup if Adempiere.properties file is missing. --- .../src/org/adempiere/webui/session/WebUIServlet.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/session/WebUIServlet.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/session/WebUIServlet.java index 60b9e8d8d1..87b49cf91a 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/session/WebUIServlet.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/session/WebUIServlet.java @@ -17,6 +17,7 @@ package org.adempiere.webui.session; +import java.io.File; import java.io.IOException; import java.util.Properties; import java.util.logging.Level; @@ -66,6 +67,12 @@ public class WebUIServlet extends DHtmlLayoutServlet serverContext.put(CLogMgt.ROOT_LOGGER_NAME_PROPERTY, WEBUI_ROOT_LOGGER_NAME); ServerContext.setCurrentInstance(serverContext); + String propertyFile = Ini.getFileName(false); + File file = new File(propertyFile); + if (!file.exists()) + { + throw new IllegalStateException("Adempiere.properties is not setup. PropertyFile="+propertyFile); + } if (!Adempiere.isStarted()) { boolean started = Adempiere.startup(false); @@ -79,7 +86,7 @@ public class WebUIServlet extends DHtmlLayoutServlet CLogMgt.initialize(false); CLogMgt.setLevel(Ini.getProperty(Ini.P_TRACELEVEL)); } - + logger = CLogger.getCLogger(WebUIServlet.class); // hengsin: temporary solution for problem with zk client