Package org.apache.cayenne

Examples of org.apache.cayenne.ConfigurationException


        return this.driverInfo;
    }

    protected InputStream getInputStream(String location) {
        if (this.parentConfiguration == null) {
            throw new ConfigurationException(
                    "No parent Configuration set - cannot continue.");
        }

        return this.parentConfiguration.getResourceLocator().findResourceStream(location);
    }
View Full Code Here


        logger.info("loading driver information from '" + location + "'.");

        InputStream in = this.getInputStream(location);
        if (in == null) {
            logger.info("Error: location '" + location + "' not found.");
            throw new ConfigurationException(
                    "Can't find DataSource configuration file at " + location);
        }

        RootHandler handler = new RootHandler();
        parser.setContentHandler(handler);
View Full Code Here

        if (in == null && !location.endsWith(".properties")) {
            in = resourceLocator.findResourceStream(location + ".properties");
        }

        if (in == null) {
            throw new ConfigurationException("DBCP properties file not found: "
                    + location);
        }

        Properties properties = new Properties();
        try {
View Full Code Here

    String getString(String property, boolean required) {
        String value = properties.getProperty(PROPERTY_PREFIX + property);

        if (required && value == null) {
            throw new ConfigurationException("No value for required property: "
                    + PROPERTY_PREFIX
                    + property);
        }

        return value;
View Full Code Here

            // try symbolic
            try {
                return GenericObjectPool.class.getField(value).getByte(null);
            }
            catch (Throwable th) {
                throw new ConfigurationException("Invalid 'whenExhaustedAction': "
                        + value);
            }
        }
    }
View Full Code Here

            // try symbolic
            try {
                return Connection.class.getField(value).getInt(null);
            }
            catch (Throwable th) {
                throw new ConfigurationException(
                        "Invalid 'defaultTransactionIsolation': " + value);
            }
        }
    }
View Full Code Here

        try {
            conf = (Configuration) configurationClass.newInstance();
        }
        catch (Exception ex) {
            logObj.error("Error creating shared Configuration: ", ex);
            throw new ConfigurationException("Error creating shared Configuration."
                    + ex.getMessage(), ex);
        }

        Configuration.initializeSharedConfiguration(conf);
    }
View Full Code Here

     * {@link #didInitialize}.
     */
    public static void initializeSharedConfiguration(Configuration conf) {
        // check to see whether we can proceed
        if (!conf.canInitialize()) {
            throw new ConfigurationException("Configuration of class "
                    + conf.getClass().getName()
                    + " refused to be initialized.");
        }

        try {
            // initialize configuration
            conf.initialize();

            // call post-initialization hook
            conf.didInitialize();

            // set the initialized Configuration only after success
            Configuration.sharedConfiguration = conf;
        }
        catch (Exception ex) {
            throw new ConfigurationException(
                    "Error during Configuration initialization. " + ex.getMessage(),
                    ex);
        }
    }
View Full Code Here

        try {
            domain = findDomain(domainName);
        }
        catch (FindException ex) {
            logObj.info("Error: Domain is not loaded: " + domainName);
            throw new ConfigurationException("Domain is not loaded: " + domainName);
        }

        domain.initWithProperties(properties);
    }
View Full Code Here

    }

    public void shouldLoadDataDomain(String domainName) {
        if (domainName == null) {
            logObj.info("Error: unnamed <domain>.");
            throw new ConfigurationException("Domain 'name' attribute must be not null.");
        }

        logObj.info("loaded domain: " + domainName);
        domains.put(domainName, new DataDomain(domainName));
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.ConfigurationException

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.