Package org.apache.cayenne

Examples of org.apache.cayenne.ConfigurationException


                + "' schema-update-strategy='"
                + schemaUpdateStrategy
                + "'>.");

        if (nodeName == null) {
            throw new ConfigurationException("Error: <node> without 'name'.");
        }

        factory = convertClassNameFromV1_2(factory);
        adapter = convertClassNameFromV1_2(adapter);
        schemaUpdateStrategy = convertClassNameFromV1_2(schemaUpdateStrategy);

        if (dataSource == null) {
            logger.info("Warning: <node> '" + nodeName + "' has no 'datasource'.");
        }

        if (factory == null) {
            if (config.getDataSourceFactory(null) != null) {
                logger.info("Warning: <node> '" + nodeName + "' without 'factory'.");
            }
            else {
                throw new ConfigurationException("Error: <node> '"
                        + nodeName
                        + "' without 'factory'.");
            }
        }
View Full Code Here


    public void shouldLinkDataMap(String domainName, String nodeName, String mapName) {

        if (mapName == null) {
            logger.info("<map-ref> has no 'name'.");
            throw new ConfigurationException("<map-ref> has no 'name'.");
        }

        logger.info("loaded map-ref: " + mapName + ".");
        DataMap map = null;
        DataNode node = null;
View Full Code Here

                StringBuilder msg = new StringBuilder(128);
                msg.append("Load failures. Main configuration class: ");
                msg.append(config.getClass().getName());
                msg.append(", details: ");
                msg.append(status.describeFailures());
                throw new ConfigurationException(msg.toString());
            }
        }

        // load missing relationships and update configuration object
        for (DataDomain domain : getDomains().values()) {
View Full Code Here

            if (projectFile.isFile()) {
                this.projectFile = projectFile;
                this.setDomainConfigurationName(projectFile.getName());
            }
            else {
                throw new ConfigurationException("Project file: "
                        + projectFile
                        + " is a directory or not readable.");
            }
        }
        else {
            throw new ConfigurationException("Cannot use null as project file.");
        }
    }
View Full Code Here

        String driver = config.getString(DRIVER_CLASS_NAME, true);
        try {
            Class.forName(driver);
        }
        catch (ClassNotFoundException e) {
            throw new ConfigurationException("Error loading driver " + driver, e);
        }
    }
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

     * {@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

      if (projectFile.isFile()) {
        this.projectFile = projectFile;
        this.setDomainConfigurationName(projectFile.getName());
      }
      else {
        throw new ConfigurationException("Project file: "
                          + projectFile
                          + " is a directory or not readable.");
      }
    }
    else {
      throw new ConfigurationException("Cannot use null as project file.");
    }
  }
View Full Code Here

        String driver = config.getString(DRIVER_CLASS_NAME, true);
        try {
            Class.forName(driver);
        }
        catch (ClassNotFoundException e) {
            throw new ConfigurationException("Error loading driver " + driver, e);
        }
    }
View Full Code Here

     */
    public DefaultConfiguration(String domainConfigurationName) {
        super(domainConfigurationName);

        if (domainConfigurationName == null) {
            throw new ConfigurationException("cannot use null as domain file name.");
        }

        logger.debug("using domain file name: " + domainConfigurationName);

        // configure CLASSPATH-only locator
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.