if (websrv == null) {
    public void run () {	try {	    // start embedded web server if port is specified	    if (webport > 0) {	        websrv = new Acme.Serve.Serve (webport, sysProps);	    }                 String xmlparser = sysProps.getProperty ("xmlparser");	    if (xmlparser != null)	        XmlRpc.setDriver (xmlparser);	    // XmlRpc.setDebug (true);	    xmlrpc = new WebServer (port+1);	    if (paranoid) {	        xmlrpc.setParanoid (true);	        String xallow = sysProps.getProperty ("allowXmlRpc");	        if (xallow != null) {	            StringTokenizer st = new StringTokenizer (xallow, " ,;");	            while (st.hasMoreTokens ())	                xmlrpc.acceptClient (st.nextToken ());	        }	    }	    getLogger().log ("Starting XML-RPC server on port "+(port+1));	    // the following seems not to be necessary after all ...	    // System.setSecurityManager(new RMISecurityManager());	    if (paranoid) {	        HopSocketFactory factory = new HopSocketFactory ();	        String rallow = sysProps.getProperty ("allowWeb");	        if (rallow != null) {	            StringTokenizer st = new StringTokenizer (rallow, " ,;");	            while (st.hasMoreTokens ())	                factory.addAddress (st.nextToken ());	        }	        RMISocketFactory.setSocketFactory (factory);	    }	    // if (websrv == null) {	        getLogger().log ("Starting server on port "+port);	        LocateRegistry.createRegistry (port);	    // }	    // start application framework	    appsProps = new SystemProperties (appsPropfile);	    appManager = new ApplicationManager (port, hopHome, appsProps, this);	} catch (Exception gx) {	    getLogger().log ("Error initializing embedded database: "+gx);	    gx.printStackTrace ();	    return;             }	// start applications	appManager.startAll ();	// start embedded web server	if (websrv != null) {	    Thread webthread = new Thread (websrv, "WebServer");	    webthread.start ();	}	int count = 0;	while (Thread.currentThread () == mainThread) {	    try {	        mainThread.sleep (3000l);	    } catch (InterruptedException ie) {}	    try {	        appManager.checkForChanges ();	    } catch (Exception x) {	        getLogger().log ("Caught in app manager loop: "+x);	    }	}    }