public static void main(String[] args) {
        if (log.isDebugEnabled())
            log.debug("Method call");
        View view = null;
        try {
            view = (View) new ViewFactory().newInstance("console");
            ServerModel server = new Server();
            Controller controller = new Controller(server, view);
            controller.readServerSources();
            server.setXmlPath(controller.getXmlpath());
            server.setDtdPath(controller.getDtdpath());
            server.readDocument();
            view.setController(controller);
            view.setModel(server);
            controller.startSavingThread();
            controller.exitHandler();
            view.starting();
        } catch (ServerException ex) {
            ControllerException e = new ControllerException(ex);
            log.error("Exception", e);
            if (view != null)
                view.exceptionHandling(e);
        } catch (ControllerException e) {
            ControllerException ex = new ControllerException(e);
            log.error("Exception", ex);
            if (view != null)
                view.exceptionHandling(ex);
        } catch (IOException e) {
            ControllerException ex = new ControllerException(e);
            log.error("Exception", ex);
            if (view != null)
                view.exceptionHandling(ex);
        }
    }