Package org.apache.cayenne

Examples of org.apache.cayenne.ConfigurationException


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

        // load DataMaps tree
        Iterator it = locations.keySet().iterator();
        while (it.hasNext()) {
View Full Code Here


     * loaded and linked with the DataDomain.
     */
    protected DataMap loadDataMap(DataDomain domain, String mapName, Map locations) {

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

        String location = (String) locations.get(mapName);

        if (location == null) {
            throw new ConfigurationException("Error: map '"
                    + mapName
                    + "' without 'location'.");
        }

        // load DataMap
View Full Code Here

                + "' factory='"
                + factory
                + "'>.");

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

        if (dataSource == null) {
            logObj.info("Warning: <node> '" + nodeName + "' has no 'datasource'.");
        }
  
        if (factory == null) {
            if (config.getDataSourceFactory() != null) {
                logObj.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) {
            logObj.info("<map-ref> has no 'name'.");
            throw new ConfigurationException("<map-ref> has no 'name'.");
        }

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

                StringBuffer msg = new StringBuffer(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());
            }
        }

        // update configuration object
        Iterator it = getDomains().values().iterator();
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

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

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

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

        // configure CLASSPATH-only locator
View Full Code Here

            StringBuffer msg = new StringBuffer();
            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 {
                // 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

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.