private void init() throws ApplicationException, IOException {
    if (config == null) {
      config = loadConfigFromClasspath();
    }

    if (port == 0) {
      try {
        port = Integer.parseInt(config.getProperty("port"));
      } catch (NumberFormatException | NullPointerException ex) {
        port = DEFAULT_PORT;
      }
    }

    if (context == null) {
      context = config.getProperty("context");
      if (context == null) {
        context = DEFAULT_CONTEXT;
      }
    }

    if (!context.startsWith("/")) {
      throw new ApplicationException("context must starts with /", null);
    }

    if (bufferSize == 0) {
      try {
        bufferSize = Integer.parseInt(config.getProperty("buffer_size"));
      } catch (NumberFormatException | NullPointerException ex) {
        bufferSize = DEFAULT_BUFFER_SIZE;
      }
    }

    loadServices();
    _showConfigAndResources();
  }