try {
writer = new FileWriter(serverXml);
writer.write(value
.replace(parser.http(), Integer.toString(tomeeHttpPort))
.replace(parser.https(), Integer.toString(tomeeHttpsPort))
.replace(parser.ajp(), Integer.toString(tomeeAjpPort))
.replace(parser.stop(), Integer.toString(tomeeShutdownPort))
.replace(parser.host(), tomeeHost)
.replace(parser.appBase(), webappDir));
} catch (IOException e) {
throw new TomEEException(e.getMessage(), e);