Examples of ConfigurationException


Examples of org.apache.slide.projector.ConfigurationException

                            requiredFragmentDefined = true;
                            break;
                        }
                    }
                    if ( !requiredFragmentDefined ) {
                        throw new ConfigurationException(new ErrorMessage("templateRenderer/requiredFragmentMissing", new String[] { requiredFragments[i] }));
                    }
                }
            }
            parameterDescriptions.add(new ParameterDescriptor(FRAGMENT, new ParameterMessage("templateRenderer/fragment"), new StringValueDescriptor((String [])templates.keySet().toArray(new String[0])), new StringValue(DEFAULT_FRAGMENT)));
            if ( fragments ) {
View Full Code Here

Examples of org.apache.slide.util.conf.ConfigurationException

      throws ConfigurationException {

        try {
            return this.configuration.getAttribute(paramName);
        } catch (org.apache.avalon.framework.configuration.ConfigurationException ce) {
            throw new ConfigurationException(ce.getMessage(), this);
        }
    }
View Full Code Here

Examples of org.apache.sling.commons.log.logback.internal.config.ConfigurationException

        ServiceReference sr = this.bundleContext
                .getServiceReference(ConfigurationAdmin.class.getName());
        if (sr != null) {
            try {
                if (logLevel == null) {
                    throw new ConfigurationException(LogConfigManager.LOG_LEVEL,
                            "Log level has to be specified.");
                }
                if (loggers == null) {
                    throw new ConfigurationException(LogConfigManager.LOG_LOGGERS,
                            "Logger categories have to be specified.");
                }
                if (logFile == null) {
                    throw new ConfigurationException(LogConfigManager.LOG_FILE,
                            "LogFile name has to be specified.");
                }
                // try to get the configadmin
                final ConfigurationAdmin configAdmin = (ConfigurationAdmin) this.bundleContext
                        .getService(sr);
View Full Code Here

Examples of org.apache.torque.generator.configuration.ConfigurationException

                            detokenizedPath);
                result = load(templateInputStream, encoding, templateFilter);
            }
            catch (IOException e)
            {
                throw new ConfigurationException(e);
            }
            finally
            {
                if (templateInputStream != null)
                {
View Full Code Here

Examples of org.apache.tuscany.core.config.ConfigurationException

            Module newModule = (Module) model;
            module = newModule;
            for (Component component : newModule.getComponents()) {
                Implementation componentImplementation = component.getImplementation();
                if (componentImplementation == null) {
                    ConfigurationException e = new MissingImplementationException("Component implementation not set");
                    e.addContextName(component.getName());
                    e.addContextName(getName());
                    throw e;
                }
                configuration = (ContextFactory<Context>) component.getContextFactory();
                if (configuration == null) {
                    ConfigurationException e = new MissingContextFactoryException("Context factory not set");
                    e.addContextName(component.getName());
                    e.addContextName(getName());
                    throw e;
                }
                registerConfiguration(configuration);
                if (component instanceof ModuleComponent) {
                    registerAutowire((ModuleComponent) component);
                } else {
                    registerAutowire(component);
                }
            }
            for (EntryPoint ep : newModule.getEntryPoints()) {
                configuration = (ContextFactory<Context>) ep.getContextFactory();
                if (configuration == null) {
                    ConfigurationException e = new MissingContextFactoryException("Context factory not set");
                    e.setIdentifier(ep.getName());
                    e.addContextName(getName());
                    throw e;
                }
                registerConfiguration(configuration);
                registerAutowire(ep);
            }
            for (ExternalService service : newModule.getExternalServices()) {
                configuration = (ContextFactory<Context>) service.getContextFactory();
                if (configuration == null) {
                    ConfigurationException e = new MissingContextFactoryException("Context factory not set");
                    e.setIdentifier(service.getName());
                    e.addContextName(getName());
                    throw e;
                }
                registerConfiguration(configuration);
                registerAutowire(service);
            }
            if (lifecycleState == RUNNING) {
                for (Component component : newModule.getComponents()) {
                    ContextFactory<Context> contextFactory = (ContextFactory<Context>) component.getContextFactory();
                    wireSource(contextFactory);
                    buildTarget(contextFactory);
                    contextFactory.prepare(this);
                    try {
                        if (contextFactory.getSourceWireFactories() != null) {
                            for (SourceWireFactory sourceWireFactory : contextFactory.getSourceWireFactories())
                            {
                                sourceWireFactory.initialize();
                            }
                        }
                        if (contextFactory.getTargetWireFactories() != null) {
                            for (TargetWireFactory targetWireFactory : contextFactory.getTargetWireFactories()
                                    .values()) {
                                targetWireFactory.initialize();
                            }
                        }
                    } catch (WireFactoryInitException e) {
                        ProxyConfigurationException ce = new ProxyConfigurationException(e);
                        ce.addContextName(getName());
                        throw ce;
                    }

                }
                for (EntryPoint ep : newModule.getEntryPoints()) {
                    ContextFactory<Context> contextFactory = (ContextFactory<Context>) ep.getContextFactory();
                    wireSource(contextFactory);
                    buildTarget(contextFactory);
                    contextFactory.prepare(this);
                    try {
                        if (contextFactory.getSourceWireFactories() != null) {
                            for (SourceWireFactory sourceWireFactory : contextFactory.getSourceWireFactories())
                            {
                                sourceWireFactory.initialize();
                            }
                        }
                        if (contextFactory.getTargetWireFactories() != null) {
                            for (TargetWireFactory targetWireFactory : contextFactory.getTargetWireFactories()
                                    .values()) {
                                targetWireFactory.initialize();
                            }
                        }
                    } catch (WireFactoryInitException e) {
                        ProxyConfigurationException ce = new ProxyConfigurationException(e);
                        ce.addContextName(getName());
                        throw ce;
                    }

                }
                for (ExternalService es : newModule.getExternalServices()) {
                    ContextFactory<Context> contextFactory = (ContextFactory<Context>) es.getContextFactory();
                    wireSource(contextFactory);
                    buildTarget(contextFactory);
                    contextFactory.prepare(this);
                    try {
                        if (contextFactory.getSourceWireFactories() != null) {
                            for (SourceWireFactory sourceWireFactory : contextFactory.getSourceWireFactories())
                            {
                                sourceWireFactory.initialize();
                            }
                        }
                        if (contextFactory.getTargetWireFactories() != null) {
                            for (WireFactory targetWireFactory : contextFactory.getTargetWireFactories()
                                    .values()) {
                                targetWireFactory.initialize();
                            }
                        }
                    } catch (WireFactoryInitException e) {
                        ProxyConfigurationException ce = new ProxyConfigurationException(e);
                        ce.addContextName(getName());
                        throw ce;
                    }

                }

            }
            // merge existing module component assets
            module.getComponents().addAll(oldModule.getComponents());
            module.getEntryPoints().addAll(oldModule.getEntryPoints());
            module.getExternalServices().addAll(oldModule.getExternalServices());
        } else {
            if (model instanceof Component) {
                Component component = (Component) model;
                module.getComponents().add(component);
                configuration = (ContextFactory<Context>) component.getContextFactory();
                if (configuration == null) {
                    ConfigurationException e = new MissingContextFactoryException("Context factory not set");
                    e.setIdentifier(component.getName());
                    e.addContextName(getName());
                    throw e;
                }
                registerConfiguration(configuration);
                if (component instanceof ModuleComponent) {
                    registerAutowire((ModuleComponent) component);
                } else {
                    registerAutowire(component);
                }
            } else if (model instanceof EntryPoint) {
                EntryPoint ep = (EntryPoint) model;
                module.getEntryPoints().add(ep);
                configuration = (ContextFactory<Context>) ep.getContextFactory();
                if (configuration == null) {
                    ConfigurationException e = new MissingContextFactoryException("Context factory not set");
                    e.setIdentifier(ep.getName());
                    e.addContextName(getName());
                    throw e;
                }
                registerConfiguration(configuration);
                registerAutowire(ep);
            } else if (model instanceof ExternalService) {
                ExternalService service = (ExternalService) model;
                module.getExternalServices().add(service);
                configuration = (ContextFactory<Context>) service.getContextFactory();
                if (configuration == null) {
                    ConfigurationException e = new MissingContextFactoryException("Context factory not set");
                    e.setIdentifier(service.getName());
                    e.addContextName(getName());
                    throw e;
                }
                registerConfiguration(configuration);
                registerAutowire(service);
            } else {
                BuilderConfigException e = new BuilderConfigException("Unknown model type");
                e.setIdentifier(model.getClass().getName());
                e.addContextName(getName());
                throw e;
            }
        }
    }
View Full Code Here

Examples of org.apache.xindice.util.ConfigurationException

        // The configuration is wrapped in a <xindice> element so we need to get the "root-collection" configuration.
        //
        try {
            Configuration rootCollectionConfiguration = configuration.getChild("root-collection");
            if (rootCollectionConfiguration == null) {
                throw new ConfigurationException("The database configuration is missing the <root-collection> element");
            } else {

                //
                // We need to ensure that the database points to a place where it makes
                // sense. If the path in the system.xml file is an absolute path, then
                // honor it. If it's not, we first check for the system property "xindice.db.home"
                // and if the lookup is successful we use it as the database root parent. If
                // the property is not set, we use /WEB-INF relative to the servlet context, unless
                // the war has not been unpacked. In this case, we throw an exception and
                // ask the user to specify the location of database root
                //
                String dbRoot = rootCollectionConfiguration.getAttribute(Database.DBROOT, Database.DBROOT_DEFAULT);

                //
                // If there is no absolute path, we have to perform some checks.
                //
                if (!new File(dbRoot).isAbsolute()) {

                    // Stupid hack but spec compliant:
                    // If getRealPath() returns null the war archive has not been unpacked.
                    String realPath = servletConfig.getServletContext().getRealPath("/WEB-INF");

                    // Let's see if the property was specified.
                    String home = System.getProperty(Xindice.PROP_XINDICE_DB_HOME);
                    if (log.isDebugEnabled()) {
                        log.debug(Xindice.PROP_XINDICE_DB_HOME + " is set to " + home);
                    }

                    if (home != null) {
                        dbRoot = new File(home + File.separator + dbRoot).getCanonicalPath();
                    } else if (realPath != null) {
                        dbRoot = new File(realPath + File.separator + dbRoot).getCanonicalPath();
                        log.warn("The database root directory has been set to " + dbRoot +
                                 ". Keep in mind that if a war upgrade will take place the database will be lost.");
                    } else {
                        throw new ConfigurationException(
                                "The database configuration points to a relative path, "
                                + "but there was no " + Xindice.PROP_XINDICE_DB_HOME + " property set. "
                                + "Furthermore, the war was not unpacked by the application server "
                                + "so Xindice was unable to find a database location "
                                + "Please check /WEB-INF/system.xml and set an absolute path "
                                + "as the \"dbroot\" attribute of \"root-collection\" "
                                + "or specify a suitable " + Xindice.PROP_XINDICE_DB_HOME + " system property.");
                    }
                    rootCollectionConfiguration.setAttribute(Database.DBROOT, dbRoot);
                }

                //
                // We need to use this method to be consistent between deployments (embed, standalone, etc)
                // and let the Database object maintain the set of Databases.
                //
                this.database = Database.getDatabase(rootCollectionConfiguration);
            }

            // Setup the XML-RPC impl to support UTF-8 input via Xerces.
            XmlRpc.setEncoding("UTF8");

            /*
             * Setup the SAX parser XML-RPC impl will use.
             * The XmlRpc.setDriver() method takes either the classname or a shorthand
             * name for the SAX parser it will use.  The default (for backwards compatibility
             * if nothing else) is xerces.
             */
            String xmlrpcDriver = DEFAULT_XMLRPC_DRIVER;

            Configuration xmlRpcConfiguration = configuration.getChild("xml-rpc");
            if (xmlRpcConfiguration != null) {
                Configuration xmlRpcDriverConfiguration = xmlRpcConfiguration.getChild("driver");
                if (xmlRpcDriverConfiguration != null) {
                    // xmlrpcDriver will have non-empty value, guaranteed by providing default value
                    xmlrpcDriver = xmlRpcDriverConfiguration.getAttribute("name", DEFAULT_XMLRPC_DRIVER);
                }
            }

            try {
                XmlRpc.setDriver(xmlrpcDriver);
            } catch (Exception e) {
                throw new ConfigurationException("Failed to set driver for XmlRpc to: " + xmlrpcDriver, e);
            }

            // Create the XML-RPC server and add our handler as the default.
            this.xmlrpcServer = new XmlRpcServer();
            try {
                this.xmlrpcServer.addHandler("$default", new RPCMessageInterface());
            } catch (Exception e) {
                throw new ConfigurationException("Failed to add default handler to XmlRpc server.", e);
            }

            log.info("Database successfully started");
        } catch (Exception e) {
            log.fatal("Failed to initialize database, throwing ServletException", e);
View Full Code Here

Examples of org.arch.dns.exception.ConfigurationException

    {
      udpSocket = new DatagramSocket();
    }
    catch (java.net.SocketException e)
    {
      NamingException ne = new ConfigurationException();
      ne.setRootCause(e);
      throw ne;
    }
   
    this.servers = new InetAddress[servers.length];
    serverPorts = new int[servers.length];
   
    for (int i = 0; i < servers.length; i++)
    {
     
      // Is optional port given?
      int colon = servers[i].indexOf(':', servers[i].indexOf(']') + 1);
     
      serverPorts[i] = (colon < 0) ? DEFAULT_PORT : Integer
              .parseInt(servers[i].substring(colon + 1));
      String server = (colon < 0) ? servers[i] : servers[i].substring(0,
              colon);
      try
      {
        this.servers[i] = InetAddress.getByName(server);
      }
      catch (java.net.UnknownHostException e)
      {
        NamingException ne = new ConfigurationException(
                "Unknown DNS server: " + server);
        ne.setRootCause(e);
        throw ne;
      }
    }
    reqs = Collections.synchronizedSet(new HashSet<Integer>());
    resps = Collections.synchronizedMap(new HashMap<Integer, byte[]>());
View Full Code Here

Examples of org.archive.wayback.exception.ConfigurationException

   * start the background index merging thread
   * @throws ConfigurationException
   */
  public void init() throws ConfigurationException {
    if(index == null) {
      throw new ConfigurationException("No index target on bdb updater");
    }
    if(incoming == null) {
      throw new ConfigurationException("No incoming on bdb updater");     
    }
    startUpdateThread();
  }
View Full Code Here

Examples of org.atomojo.app.db.ConfigurationException

         conf.load(serverConfFile.toURI());
         initStorageClass();
         try {
            web = new WebComponent(dir,dbList,getStorageFactory(),conf);
         } catch (Exception ex) {
            throw new ConfigurationException("Cannot load storage "+storageClassName,ex);
         }
      } else {
         create = true;
      }
     
View Full Code Here

Examples of org.candlepin.common.config.ConfigurationException

            }

            protected Configuration readConfiguration(ServletContext context)
                throws ConfigurationException {

                throw new ConfigurationException("the ship is sinking");
            }
        };
        prepareForInitialization();
        listener.contextInitialized(evt);
    }
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.