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.");
        }

        URL url = parentConfiguration.getResourceFinder().getResource(location);

        try {
            return url != null ? url.openStream() : null;
        }
        catch (IOException e) {
            throw new ConfigurationException("Error reading URL " + url, e);
        }
    }
View Full Code Here


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

        InputStream in = 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 (url == null && !location.endsWith(".properties")) {
            url = resourceLocator.getResource(location + ".properties");
        }

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

        Properties properties = new Properties();
        InputStream in = url.openStream();
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 {
                // disable class indexing
                findDomain(domainName).getEntityResolver().setIndexedByClass(false);
            }
            catch (Exception ex) {
                throw new ConfigurationException("Domain is not loaded: " + domainName);
            }
        }
View Full Code Here

                    findDomain(domainName).getProperties().put(
                            DataDomain.DATA_CONTEXT_FACTORY_PROPERTY,
                            dataContextFactory);
                }
                catch (Exception ex) {
                    throw new ConfigurationException("Domain is not loaded: "
                            + domainName);
                }
            }
        }
View Full Code Here

            StringBuilder msg = new StringBuilder();
            msg.append("[").append(this.getClass().getName()).append(
                    "] : Domain configuration file \"").append(
                    this.getDomainConfigurationName()).append("\" is not found.");

            throw new ConfigurationException(msg.toString());
        }

        ConfigLoaderDelegate delegate = this.getLoaderDelegate();
        if (delegate == null) {
            delegate = new RuntimeLoadDelegate(this, this.getLoadStatus());
View Full Code Here

        try {
            conf = 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

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.