Package org.jboss.cache.config

Examples of org.jboss.cache.config.ConfigurationException


      // scan to be sure the _default_ region isn't added twice
      boolean setDefault = false;
      for (EvictionRegionConfig erc : ercs)
      {
         Fqn fqn = erc.getRegionFqn();
         if (fqn == null) throw new ConfigurationException("Regions cannot be configured with a null region fqn.  If you configured this region programmatically, ensure that you set the region fqn in EvictionRegionConfig");
         if (trace) log.trace("Creating eviction region " + fqn);

         if (fqn.equals(DEFAULT_REGION) || fqn.isRoot())
         {
            if (setDefault)
            {
               throw new ConfigurationException("A default region for evictions has already been set for this cache");
            }
            if (trace) log.trace("Applying settings for default region to Fqn.ROOT");
            fqn = Fqn.ROOT;
            setDefault = true;
         }
View Full Code Here


   private void sanityCheckJGroupsStack(JChannel channel)
   {
      if (channel.getProtocolStack().findProtocol(STREAMING_STATE_TRANSFER.class) == null)
      {
         throw new ConfigurationException("JGroups channel does not use STREAMING_STATE_TRANSFER!  This is a requirement for non-blocking state transfer.  Either make sure your JGroups configuration uses STREAMING_STATE_TRANSFER or disable non-blocking state transfer.");
      }
   }
View Full Code Here

   {
      if (isInLocalMode || !nonBlockingStateTransfer || !fetchStateOnStart) return; // don't care about these cases!

      if (configuration.getNodeLockingScheme() != NodeLockingScheme.MVCC)
      {
         throw new ConfigurationException("Non-blocking state transfer is only supported with the MVCC node locking scheme.  Please change your node locking scheme to MVCC or disable non-blocking state transfer.");
      }

      if (isUsingBuddyReplication)
      {
         throw new ConfigurationException("Non-blocking state transfer cannot be used with buddy replication at this time.  Please disable either buddy replication or non-blocking state transfer.");
      }
   }
View Full Code Here

   public Configuration parseFile(String filename)
   {
      InputStream is = new FileLookup().lookupFile(filename);
      if (is == null)
      {
         throw new ConfigurationException("Unable to find config file " + filename + " either in classpath or on the filesystem!");
      }
      return parseStream(is);
   }
View Full Code Here

            (!"jbosscache".equals(root.getLocalName()) ||
             (!RootElementBuilder.JBOSSCACHE_CORE_NS_31.equals(coreNamespace) &&
             !RootElementBuilder.JBOSSCACHE_CORE_NS_30.equals(coreNamespace))
         ))
      {
            throw new ConfigurationException("Expected root element <jbosscache />" + (isValidating() ? " in either {" +
                  RootElementBuilder.JBOSSCACHE_CORE_NS_30 + "} or {" + RootElementBuilder.JBOSSCACHE_CORE_NS_31 + "} namespaces" : ""));
      }

      try
      {
         configureLocking(getSingleElement("locking"));
         configureTransaction(getSingleElement("transaction"));
         configureClustering(getSingleElement("clustering"));
         configureSerialization(getSingleElement("serialization"));
         configureInvalidation(getSingleElement("invalidation"));
         configureStartup(getSingleElement("startup"));
         configureShutdown(getSingleElement("shutdown"));
         configureJmxStatistics(getSingleElement("jmxStatistics"));
         configureEviction(getSingleElement("eviction"));
         configureCacheLoaders(getSingleElement("loaders"));
         configureCustomInterceptors(getSingleElement("customInterceptors"));
         configureListeners(getSingleElement("listeners"));
         configureInvocationBatching(getSingleElement("invocationBatching"));
      }
      catch (Exception e)
      {
         throw new ConfigurationException("Unexpected exception while parsing the configuration file", e);
      }
      return config;
   }
View Full Code Here

      else if (mode.startsWith("I"))
         repl = false;

      Element asyncEl = getSingleElementInCoreNS("async", e);
      Element syncEl = getSingleElementInCoreNS("sync", e);
      if (syncEl != null && asyncEl != null) throw new ConfigurationException("Cannot have sync and async elements within the same cluster element!");
      boolean sync = asyncEl == null; // even if both are null, we default to sync
      if (sync)
      {
         config.setCacheMode(repl ? CacheMode.REPL_SYNC : CacheMode.INVALIDATION_SYNC);
         configureSyncMode(syncEl);
View Full Code Here

         // search for anything we need to inject
         for (Method method : methods) invokeInjectionMethod(target, method);
      }
      catch (Exception e)
      {
         throw new ConfigurationException("Unable to configure component (type: " + target.getClass() + ", instance " + target + ")", e);
      }
   }
View Full Code Here

   {
      if (defaultFactories == null) scanDefaultFactories();
      Class<? extends ComponentFactory> cfClass = defaultFactories.get(componentClass);
      if (cfClass == null)
      {
         throw new ConfigurationException("No registered default factory for component " + componentClass + " found!");
      }
      // a component factory is a component too!  See if one has been created and exists in the registry
      ComponentFactory cf = getComponent(cfClass);
      if (cf == null)
      {
         // hasn't yet been created.  Create and put in registry
         cf = instantiateFactory(cfClass);
         if (cf == null)
         {
            throw new ConfigurationException("Unable to locate component factory for component " + componentClass);
         }
         // we simply register this factory.  Registration will take care of constructing any dependencies.
         registerComponent(cf, cfClass);
      }

      // ensure the component factory is in the STARTED state!
      Component c = componentLookup.get(cfClass.getName());
      if (c.instance != cf)
      {
         throw new ConfigurationException("Component factory " + cfClass + " incorrectly registered!");
      }
      return cf;
   }
View Full Code Here

         return factory.newInstance();
      }
      catch (Exception e)
      {
         // unable to get a hold of an instance!!
         throw new ConfigurationException("Unable to instantiate factory " + factory, e);
      }
   }
View Full Code Here

         is.close();
      }
      catch (IOException e)
      {
         log.warn("Unexpected", e);
         throw new ConfigurationException("Exception occured while reading properties from XML document", e);
      }
      return properties;
   }
View Full Code Here

TOP

Related Classes of org.jboss.cache.config.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.