public void startServer() {
        if (!started) {
            server = new Component();
            server.getServers().add(Protocol.HTTP, getConfig().getPort());
            server.getDefaultHost().attach(this);
            try {
                server.start();
                started = true;
            } catch (Exception e) {
                stopServer();
                throw new RuntimeException("Exception while starting server", e);
            }
        }
    }