Don't continue platform startup if Adempiere.properties file is missing.

This commit is contained in:
Heng Sin Low 2010-10-26 18:58:04 +08:00
parent 916fef8565
commit 29b64b7d51
1 changed files with 8 additions and 1 deletions

View File

@ -17,6 +17,7 @@
package org.adempiere.webui.session; package org.adempiere.webui.session;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.Properties; import java.util.Properties;
import java.util.logging.Level; 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.put(CLogMgt.ROOT_LOGGER_NAME_PROPERTY, WEBUI_ROOT_LOGGER_NAME);
ServerContext.setCurrentInstance(serverContext); 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()) if (!Adempiere.isStarted())
{ {
boolean started = Adempiere.startup(false); boolean started = Adempiere.startup(false);