Don't start server if Adempiere.properties doesn't exists.
This commit is contained in:
parent
470a5235a3
commit
3ce2d30129
|
@ -3,11 +3,13 @@
|
|||
*/
|
||||
package org.adempiere.server;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.exceptions.AdempiereException;
|
||||
import org.adempiere.util.ServerContext;
|
||||
import org.compiere.Adempiere;
|
||||
import org.compiere.util.Ini;
|
||||
import org.eclipse.equinox.app.IApplication;
|
||||
import org.eclipse.equinox.app.IApplicationContext;
|
||||
|
||||
|
@ -25,6 +27,12 @@ public class Application implements IApplication {
|
|||
/** Initialise context for the current thread*/
|
||||
Properties serverContext = new Properties();
|
||||
ServerContext.setCurrentInstance(serverContext);
|
||||
|
||||
String propertyFile = Ini.getFileName(false);
|
||||
File file = new File(propertyFile);
|
||||
if (!file.exists()) {
|
||||
throw new IllegalStateException("Adempiere.properties file missing. Path="+file.getAbsolutePath());
|
||||
}
|
||||
if (!Adempiere.isStarted())
|
||||
{
|
||||
boolean started = Adempiere.startup(false);
|
||||
|
|
Loading…
Reference in New Issue