debug(">upgrade");  boolean ret = false;  String database = System.getProperty("ejbcaDB"); debug("ejbcaDB="+database); String datasource = System.getProperty("ejbcaDS"); debug("ejbcaDS="+datasource); String caname= System.getProperty("ejbcaCA"); debug("ejbcaCA="+caname); String keystore = System.getProperty("ejbcaKS"); debug("ejbcaKS="+keystore); String kspwd = System.getProperty("ejbcaKSPWD"); debug("ejbcaKSPWD="+kspwd);   if (!appServerRunning()) { error("The application server must be running."); return false; } try { IUpgradeSessionRemote upgradesession = getUpgradeSessionRemote(); String[] args = new String[5]; args[0] = database; args[1] = datasource; args[2] = caname; args[3] = keystore; args[4] = kspwd; ret = upgradesession.upgrade(administrator, args); } catch (Exception e) { error("Can't upgrade: ", e); } debug("<upgrade"); return ret;
debug(">upgrade");  boolean ret = false;  String database = System.getProperty("ejbcaDB"); debug("ejbcaDB="+database); String datasource = System.getProperty("ejbcaDS"); debug("ejbcaDS="+datasource); String caname= System.getProperty("ejbcaCA"); debug("ejbcaCA="+caname); String keystore = System.getProperty("ejbcaKS"); debug("ejbcaKS="+keystore); String kspwd = System.getProperty("ejbcaKSPWD"); debug("ejbcaKSPWD="+kspwd); String os = System.getProperty("ejbcaOS"); debug("ejbcaOS="+os); String url = System.getProperty("ejbcaURL"); debug("ejbcaURL="+url);   if (!appServerRunning()) { error("The application server must be running."); return false; }  try { IUpgradeSessionRemote upgradesession = getUpgradeSessionRemote(); String[] args = new String[5]; args[0] = database; args[1] = datasource; args[2] = caname; args[3] = keystore; args[4] = kspwd; ret = upgradesession.upgrade(administrator, args); } catch (Exception e) { error("Can't upgrade: ", e); }   if(os.equalsIgnoreCase("windows")) { try { String[] command = new String[4]; command[0] = "setup.cmd"; command[1] = "setbaseurl"; command[2] = url; command[3] = "ejbca"; Process runcainit = Runtime.getRuntime().exec(command);  BufferedReader br = new BufferedReader(new InputStreamReader(runcainit.getInputStream())); Thread.sleep(1000); String line = ""; while((line = br.readLine()) != null){ System.out.println(line); } if(runcainit.waitFor() != 0){ error("Error setting baseurl"); return false; } } catch (Exception e) { error("Error setting baseurl:", e); return false; } } if(os.equalsIgnoreCase("unix")) { try { String[] command = new String[4]; command[0] = "./setup.sh"; command[1] = "setbaseurl"; command[2] = url; command[3] = "ejbca"; Process runcainit = Runtime.getRuntime().exec(command);  BufferedReader br = new BufferedReader(new InputStreamReader(runcainit.getInputStream())); Thread.sleep(1000); String line = ""; while((line = br.readLine()) != null){ System.out.println(line); } if(runcainit.waitFor() != 0){ error("Error setting baseurl"); return false; } } catch (Exception e) { error("Error setting baseurl: ", e); return false; } }  debug("<upgrade"); return ret;
    public boolean upgrade() {     debug(">upgrade");          boolean ret = false;          String database = System.getProperty("ejbcaDB");     debug("ejbcaDB="+database);     String datasource = System.getProperty("ejbcaDS");     debug("ejbcaDS="+datasource);     String caname= System.getProperty("ejbcaCA");     debug("ejbcaCA="+caname);     String keystore = System.getProperty("ejbcaKS");     debug("ejbcaKS="+keystore);     String kspwd = System.getProperty("ejbcaKSPWD");     debug("ejbcaKSPWD="+kspwd);          // Check prerequisited     if (!appServerRunning()) {        error("The application server must be running.");        return false;     }     try {        IUpgradeSessionRemote upgradesession = getUpgradeSessionRemote();        String[] args = new String[5];        args[0] = database;        args[1] = datasource;        args[2] = caname;        args[3] = keystore;        args[4] = kspwd;        ret = upgradesession.upgrade(administrator, args);     } catch (Exception e) {     	error("Can't upgrade: ", e);     }     debug("<upgrade");     return ret;    }