public Application getApplication() {

        if (this.application == null) {
            Class clazz = null;
            try {
                clazz = this.getClass().getClassLoader().loadClass
                  ("org.apache.shale.test.mock.MockApplication12");
                this.application = (MockApplication) clazz.newInstance();
            } catch (NoClassDefFoundError e) {
                clazz = null; // We are not running in a JSF 1.2 environment
            } catch (ClassNotFoundException e) {
                clazz = null; // Same as above
            } catch (RuntimeException e) {
                throw e;
            } catch (Exception e) {
                throw new FacesException(e);
            }
            if (clazz == null) {
                try {
                    clazz = this.getClass().getClassLoader().loadClass
                      ("org.apache.shale.test.mock.MockApplication");
                    this.application = (MockApplication) clazz.newInstance();
                } catch (RuntimeException e) {
                    throw e;
                } catch (Exception e) {
                    throw new FacesException(e);
                }
            }
        }
        return this.application;

    }