Examples of InvalidConfigException


Examples of com.linkedin.databus.core.util.InvalidConfigException

      // Make sure the URI from the configuration file identifies an Oracle JDBC source.
      String uri = physicalSourceConfig.getUri();
      if(!uri.startsWith("jdbc:oracle"))
      {
        throw new InvalidConfigException("Invalid source URI (" +
            physicalSourceConfig.getUri() + "). Only jdbc:oracle: URIs are supported.");
      }

      String sourceTypeStr = physicalSourceConfig.getReplBitSetter().getSourceType();
        if (SourceType.TOKEN.toString().equalsIgnoreCase(sourceTypeStr))
          throw new InvalidConfigException("Token Source-type for Replication bit setter config cannot be set for trigger-based Databus relay !!");

      // Create the OracleDataSource used to get DB connection(s)
      try
      {
        Class oracleDataSourceClass = OracleJarUtils.loadClass("oracle.jdbc.pool.OracleDataSource");
        Object ods = oracleDataSourceClass.newInstance();
        Method setURLMethod = oracleDataSourceClass.getMethod("setURL", String.class);
        setURLMethod.invoke(ods, uri);
        _sDataStore = (DataSource) ods;
      } catch (Exception e)
      {
        String errMsg = "Error creating a data source object ";
        LOG.error(errMsg, e);
        throw e;
      }

      //TODO: Need a better way than relaying on RelayFactory for generating MonitoredSourceInfo
      OracleEventProducerFactory factory = new BootstrapSeederOracleEventProducerFactory(_sStaticConfig.getController().getPKeyNameMap());

      // Parse each one of the logical sources
      _sources = new ArrayList<OracleTriggerMonitoredSourceInfo>();
      FileSystemSchemaRegistryService schemaRegistryService =
            FileSystemSchemaRegistryService.build(_sStaticConfig.getSchemaRegistry().getFileSystem());

      Set<String> seenUris = new HashSet<String>();
      for(LogicalSourceConfig sourceConfig : physicalSourceConfig.getSources())
      {
        String srcUri  = sourceConfig.getUri();
        if ( seenUris.contains(srcUri))
        {
          String msg = "Uri (" + srcUri + ") is used for more than one sources. Currently Bootstrap Seeder cannot support seeding sources with the same URI together. Please have them run seperately !!";
          LOG.fatal(msg);
          throw new InvalidConfigException(msg);
        }
        seenUris.add(srcUri);
        OracleTriggerMonitoredSourceInfo source =
            factory.buildOracleMonitoredSourceInfo(sourceConfig.build(), physicalSourceConfig.build(), schemaRegistryService);
        _sources.add(source);
View Full Code Here

Examples of com.linkedin.databus.core.util.InvalidConfigException

        File f = new File(file);
       
        if (! (f.isDirectory()) || (!f.canRead()))
        {
          LOG.error("File (" + f + ") does not exist or cannot be read !!");
          throw new InvalidConfigException("File (" + f + ") does not exist or cannot be read !!");
        }
      }
           
      return new StaticConfig(avroSeedInputDirMap, seedWindowSCNMap, pKeyNameMap, commitInterval);
    }
View Full Code Here

Examples of com.sun.enterprise.admin.servermgmt.InvalidConfigException

    final void uniquePorts(final DomainConfig dc) throws InvalidConfigException{
        final Map ports = dc.getPorts();
        final Set portValues = new HashSet(ports.values());
        if (ports.keySet().size() != portValues.size()){
            throw new InvalidConfigException(getMessage(ports));
        }
    }
View Full Code Here

Examples of org.apache.geronimo.kernel.config.InvalidConfigException

                    if (!(name instanceof AbstractName)) {
                        message.append(sep).append("a full AbstractName ");
                    }
                    message.append("configuration=").append(configName);
                    message.append(" gbeanName=").append(name);
                    throw new InvalidConfigException(message.toString());
                }
                GBeanInfo gbeanInfo = GBeanInfo.getGBeanInfo(gbean.getGBeanInfo(), classLoader);
                AbstractName abstractName = (AbstractName) name;
                GBeanData gBeanData = new GBeanData(abstractName, gbeanInfo);
                gbeanDatas.add(gBeanData);
View Full Code Here

Examples of org.apache.geronimo.kernel.config.InvalidConfigException

        // set attributes
        for (Map.Entry<String, String> entry : getAttributes().entrySet()) {
            String attributeName = entry.getKey();
            GAttributeInfo attributeInfo = gbeanInfo.getAttribute(attributeName);
            if (attributeInfo == null) {
                throw new InvalidConfigException("No attribute: " + attributeName + " for gbean: " + data.getAbstractName());
            }
            String valueString = entry.getValue();
            Object value = getValue(attributeInfo, valueString, configName, gbeanName, classLoader);
            data.setAttribute(attributeName, value);
        }

        //Clear attributes
        for (String attribute : getClearAttributes()) {
            data.clearAttribute(attribute);
        }

        //Null attributes
        for (String attribute : getNullAttributes()) {
            data.setAttribute(attribute, null);
        }

        // set references
        for (Map.Entry<String, ReferencePatterns> entry : getReferences().entrySet()) {
            String referenceName = entry.getKey();
            GReferenceInfo referenceInfo = gbeanInfo.getReference(referenceName);
            if (referenceInfo == null) {
                throw new InvalidConfigException("No reference: " + referenceName + " for gbean: " + data.getAbstractName());
            }

            ReferencePatterns referencePatterns = entry.getValue();

            data.setReferencePatterns(referenceName, referencePatterns);
View Full Code Here

Examples of org.apache.geronimo.kernel.config.InvalidConfigException

            jis = stateURL.openStream();
            ObjectInputStream ois = new ObjectInputStream(jis);
            config.readExternal(ois);
            config.setReferencePattern("ConfigurationStore", objectName);
        } catch (ClassNotFoundException e) {
            throw new InvalidConfigException("Unable to load class from config: " + configId, e);
        } finally {
            if (jis != null) {
                jis.close();
            }
        }

        ObjectName name;
        try {
            name = Configuration.getConfigurationObjectName(configId);
        } catch (MalformedObjectNameException e) {
            throw new InvalidConfigException("Cannot convert id to ObjectName: ", e);
        }
        config.setName(name);
        ObjectName pattern;
        try {
            pattern = attributeStore == null ? null : new ObjectName(attributeStore.getObjectName());
        } catch (MalformedObjectNameException e) {
            throw new InvalidConfigException("Invalid ObjectName for AttributeStore: " + attributeStore.getObjectName());
        }
        config.setReferencePattern("AttributeStore", pattern);

        try {
            kernel.loadGBean(config, Configuration.class.getClassLoader());
        } catch (Exception e) {
            throw new InvalidConfigException("Unable to register configuration", e);
        }

        try {
            kernel.setAttribute(name, "baseURL", baseURL);
        } catch (Exception e) {
            try {
                kernel.unloadGBean(name);
            } catch (Exception ignored) {
                // ignore
            }
            throw new InvalidConfigException("Cannot set baseURL", e);
        }

        return name;
    }
View Full Code Here

Examples of org.apache.geronimo.kernel.config.InvalidConfigException

        public ObjectName loadConfiguration(URI configId) throws NoSuchConfigException, IOException, InvalidConfigException {
            ObjectName configurationObjectName = null;
            try {
                configurationObjectName = Configuration.getConfigurationObjectName(configId);
            } catch (MalformedObjectNameException e) {
                throw new InvalidConfigException(e);
            }
            GBeanData configData = new GBeanData(configurationObjectName, Configuration.GBEAN_INFO);
            configData.setAttribute("id", configId);
            configData.setAttribute("domain", "test");
            configData.setAttribute("server", "bar");
            configData.setAttribute("gBeanState", NO_OBJECTS_OS);

            try {
                kernel.loadGBean(configData, Configuration.class.getClassLoader());
            } catch (Exception e) {
                throw new InvalidConfigException("Unable to register configuration", e);
            }

            return configurationObjectName;
        }
View Full Code Here

Examples of org.apache.geronimo.kernel.config.InvalidConfigException

            GBeanData config = loadConfig(configurationDir);
            configId = (URI) config.getAttribute("id");
            index.setProperty(configId.toString(), configurationDir.getName());
        } catch (Exception e) {
            delete(configurationDir);
            throw new InvalidConfigException("Unable to get ID from downloaded configuration", e);
        }

        synchronized (this) {
            saveIndex();
        }
View Full Code Here

Examples of org.apache.geronimo.kernel.config.InvalidConfigException

        return configId;
    }

    public void install(ConfigurationData configurationData, File source) throws IOException, InvalidConfigException {
        if (!source.isDirectory()) {
            throw new InvalidConfigException("Source must be a directory: source=" + source);
        }
        if (!source.getParentFile().equals(rootDir)) {
            throw new InvalidConfigException("Source must be within the config store: source=" + source + ", configStoreDir=" + rootDir);
        }

        ExecutableConfigurationUtil.writeConfiguration(configurationData, source);

        // update the index
View Full Code Here

Examples of org.apache.geronimo.kernel.config.InvalidConfigException

        ObjectName name;
        try {
            name = Configuration.getConfigurationObjectName(configId);
        } catch (MalformedObjectNameException e) {
            throw new InvalidConfigException("Cannot convert id to ObjectName: ", e);
        }
        config.setName(name);
        ObjectName pattern;
        try {
            pattern = attributeStore == null ? null : new ObjectName(attributeStore.getObjectName());
        } catch (MalformedObjectNameException e) {
            throw new InvalidConfigException("Invalid ObjectName for AttributeStore: " + attributeStore.getObjectName());
        }
        config.setReferencePattern("AttributeStore", pattern);

        try {
            kernel.loadGBean(config, Configuration.class.getClassLoader());
        } catch (Exception e) {
            throw new InvalidConfigException("Unable to register configuration", e);
        }

        try {
            kernel.setAttribute(name, "baseURL", getRoot(configId).toURL());
        } catch (Exception e) {
            try {
                kernel.unloadGBean(name);
            } catch (Exception ignored) {
                // ignore
            }
            throw new InvalidConfigException("Cannot set baseURL", e);
        }
        log.info("Loaded Configuration " + name);

        return name;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.