Package org.fcrepo.server.errors

Examples of org.fcrepo.server.errors.ServerInitializationException


                        beanDefinition.setAttribute("name", name);
                        beanDefinition.setAttribute("id", name);
                        registerBeanDefinition(name, beanDefinition);
                    }
                    catch (IOException e){
                        throw new ServerInitializationException(e.toString(),e);
                    }
                }
            }
        }
        for (String rebuilder:REBUILDERS){
            try{
                ScannedGenericBeanDefinition beanDefinition = Server.getScannedBeanDefinition(rebuilder);
                beanDefinition.setAutowireCandidate(true);
                beanDefinition.setAutowireMode(AbstractBeanDefinition.AUTOWIRE_BY_NAME);
                beanDefinition.setAttribute("id", rebuilder);
                beanDefinition.setAttribute("name", rebuilder);
                beanDefinition.setInitMethodName("init");
                beanDefinition.setScope(BeanDefinition.SCOPE_SINGLETON);
                beanDefinition.setDependencyCheck(AbstractBeanDefinition.DEPENDENCY_CHECK_NONE);
                registerBeanDefinition(rebuilder, beanDefinition);
            }
            catch (IOException e){
                throw new ServerInitializationException(e.toString(),e);
            }
        }
        File fedoraHome = new File(Constants.FEDORA_HOME);
        File springWeb = new File(fedoraHome, "server/config/spring/web");
        String policyIndexName = System.getProperty("FEDORA_POLICY_INDEX_CONFIG");
View Full Code Here


                s_instances.put(homeDir, inst);
                inst.init();
                return inst;
            } catch (IllegalArgumentException iae) {
                // improbable
                throw new ServerInitializationException(MessageFormat
                        .format(INIT_SERVER_SEVERE_BADARGS,
                                new Object[] {className}));
            }
    }
View Full Code Here

        String fedoraServerPort = null;

        // fedoraServerHost (required)
        fedoraServerHost = getParameter("fedoraServerHost");
        if (fedoraServerHost == null) {
            throw new ServerInitializationException("Parameter fedoraServerHost "
                    + "not given, but it's required.");
        }
        // fedoraServerPort (required)
        fedoraServerPort = getParameter("fedoraServerPort");
        if (fedoraServerPort == null) {
            throw new ServerInitializationException("Parameter fedoraServerPort "
                    + "not given, but it's required.");
        }

        logger.info("Fedora Version: " + Server.VERSION);
        logger.info("Fedora Build Date: " + Server.BUILD_DATE);

        ServerStatusFile status = getStatusFile();
        try {
            status.append(ServerState.STARTING,
                    "Fedora Version: " + Server.VERSION);
            status.append(ServerState.STARTING,
                    "Fedora Build Date: " + Server.BUILD_DATE);
            status.append(ServerState.STARTING, "Server Host Name: "
                    + fedoraServerHost);
            status.append(ServerState.STARTING, "Server Port: "
                    + fedoraServerPort);
        } catch (Exception e) {
            e.printStackTrace();
            throw new ServerInitializationException("Unable to write to status file: "
                    + e.getMessage());
        }
    }
View Full Code Here

            preIngestIfNeeded(firstRun, doManager, Models.FEDORA_OBJECT_3_0);
            preIngestIfNeeded(firstRun, doManager, Models.SERVICE_DEFINITION_3_0);
            preIngestIfNeeded(firstRun, doManager, Models.SERVICE_DEPLOYMENT_3_0);
            checkRebuildHasRun(firstRun);
        } catch (Exception e) {
            throw new ServerInitializationException("Failed to ingest "
                                                    + "system object(s)", e);
        }
    }
View Full Code Here

            } else {
                // otherwise, verify that the most recent rebuild was successful
                boolean rebuildFinished =
                        SQLUtility.getRebuildStatus(conn, mostRecentRebuildDate);
                if (!rebuildFinished) {
                    throw new ServerInitializationException(
                            "The SQL Rebuild attempted on "
                            + new Date(mostRecentRebuildDate).toGMTString()
                            + " did not finish successfully, which may compromise"
                            + " the repo. Please re-run the SQL rebuild.");
                }
View Full Code Here

        m_serverDir = new File(homeDir, "server");
        m_uploadDir = new File(m_serverDir, "management/upload");
        try{
            m_statusFile = new ServerStatusFile(m_serverDir);
        } catch (Exception e) {
            throw new ServerInitializationException(e.toString());
        }
        File logDir = new File(m_serverDir, "logs");
        if (!logDir.exists()) {
            logDir.mkdir(); // try to create dir if doesn't exist
        }
View Full Code Here

            // ensure server's module roles are met
            String[] reqRoles = getRequiredModuleRoles();
            for (String element : reqRoles) {
                if (!knownBeanDefinition(element) && serverConfig.getModuleConfiguration(element) == null) {
                    throw new ServerInitializationException(MessageFormat
                            .format(INIT_SERVER_SEVERE_UNFULFILLEDROLE,
                                    new Object[] {element}));
                }
            }
View Full Code Here

     * Register any implementation-specific bean definitions before the context is refreshed.
     * @throws ServerInitializationException
     */
    protected void registerBeanDefinitions() throws ServerInitializationException {
        if (1 == 2) {
            throw new ServerInitializationException(null);
        }
    }
View Full Code Here

                        if (valueNode == null) {
                            valueNode =
                                    attrs.getNamedItem(CONFIG_ATTRIBUTE_VALUE);
                        }
                        if (nameNode == null || valueNode == null) {
                            throw new ServerInitializationException(INIT_CONFIG_SEVERE_INCOMPLETEPARAM);
                        }
                    }
                    if (nameNode.getNodeValue().equals("")
                            || valueNode.getNodeValue().equals("")) {
                        throw new ServerInitializationException(MessageFormat
                                .format(INIT_CONFIG_SEVERE_INCOMPLETEPARAM,
                                        new Object[] {CONFIG_ELEMENT_PARAM,
                                                CONFIG_ATTRIBUTE_NAME,
                                                CONFIG_ATTRIBUTE_VALUE}));
                    }
                    if (params.get(nameNode.getNodeValue()) != null) {
                        throw new ServerInitializationException(MessageFormat
                                .format(INIT_CONFIG_SEVERE_REASSIGNMENT,
                                        new Object[] {CONFIG_ELEMENT_PARAM,
                                                CONFIG_ATTRIBUTE_NAME,
                                                nameNode.getNodeValue()}));
                    }
View Full Code Here

        if (okToStart) {
            return getInstance(homeDir);
        } else {
            Server instance = s_instances.get(homeDir);
            if (instance == null) {
                throw new ServerInitializationException("The Fedora server is not yet running.");
            } else {
                return instance;
            }
        }
View Full Code Here

TOP

Related Classes of org.fcrepo.server.errors.ServerInitializationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.