title: Symfony2. There is no extension able to load the configuration. Custom configuration block
body: <p>I am start my first project in symfony 2. I use Symfony 2.6.6</p>
  
  <p>My AppKernel.php</p>
  
  <pre><code>&lt;?php
  
  use Symfony\Component\HttpKernel\Kernel;
  use Symfony\Component\Config\Loader\LoaderInterface;
  
  class AppKernel extends Kernel
  {
      public function registerBundles()
      {
          $bundles = array(
              new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
              new Symfony\Bundle\SecurityBundle\SecurityBundle(),
              new Symfony\Bundle\TwigBundle\TwigBundle(),
              new Symfony\Bundle\MonologBundle\MonologBundle(),
              new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
              new Symfony\Bundle\AsseticBundle\AsseticBundle(),
              new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
              new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
              new FOS\UserBundle\FOSUserBundle(),
              new AppBundle\AppBundle(),
          );
  
          if (in_array($this-&gt;getEnvironment(), array('dev', 'test'))) {
              $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
              $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
              $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
              $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
              $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
          }
  
          return $bundles;
      }
  
      public function registerContainerConfiguration(LoaderInterface $loader)
      {
          $loader-&gt;load($this-&gt;getRootDir().'/config/config_'.$this-&gt;getEnvironment().'.yml');
      }
  }
  </code></pre>
  
  <p>And my src/AppBundle/DependencyInjection\AppExtension.php</p>
  
  <pre><code>&lt;?php
  namespace AppBundle\DependencyInjection;
  
  use Symfony\Component\HttpKernel\DependencyInjection\Extension;
  use Symfony\Component\DependencyInjection\ContainerBuilder;
  use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
  use Symfony\Component\Config\FileLocator;
  
  class AppExtension extends Extension
  {
      public function load(array $configs, ContainerBuilder $container)
      {
          $configuration = new Configuration();
          $config = $this-&gt;processConfiguration($configuration, $configs);
  
          $loader = new YamlFileLoader(
              $container,
              new FileLocator(__DIR__.'/../Resources/config')
          );
          $loader-&gt;load('services.yml');
  
      }
  }
  </code></pre>
  
  <p>My configuration class src/AppBundle/DependencyInjection\Configuration.php</p>
  
  <pre><code>&lt;?php
  
  namespace AppBundle\DependencyInjection;
  
  use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
  use Symfony\Component\Config\Definition\ConfigurationInterface;
  
  class Configuration implements ConfigurationInterface
  {
      /**
       * Generates the configuration tree.
       *
       * @return TreeBuilder
       */
      public function getConfigTreeBuilder()
      {
          $treeBuilder = new TreeBuilder();
          $rootNode = $treeBuilder-&gt;root('karmed');
          $rootNode-&gt;children()-&gt;scalarNode('var')-&gt;end();
  
          return $treeBuilder;
      }
  }
  </code></pre>
  
  <p>And part of app/config/config.yml</p>
  
  <pre><code>karmed:
    var: off
  </code></pre>
  
  <p>I don't understand why i have this message when i called app/console?</p>
  
  <pre><code>  [Symfony\Component\Config\Exception\FileLoaderLoadException]    There is no extension able to load the configuration for "karmed" (in /home/vstas/data/work/karmed/app/config/config.yml). Looked for namespace "karmed", found "framework", "security", "twig", "monolog", "swiftmailer", "assetic", "doctrine", "sensio_framework_extra", "fos_user", "app", "debug", "web_profiler", "sensio_distribution" in /home/vstas/data/work/karmed/app/config/config.yml (which is being imported from "/home/vstas/data/work/karmed/app/config/config_dev.yml").  
  </code></pre>
  
  <p>I try remove all files from directory app/cache</p>
  
  <p>I think the problem is configuration loading order, because when i try to change AppExtension to</p>
  
  <pre><code>.....
  class AppExtension extends Extension
  {
      public function load(array $configs, ContainerBuilder $container)
      {
          print "exit";
          exit();
          $configuration = new Configuration();
  .....
  </code></pre>
  
  <p>Nothing changes. 
  But when i remove from config.yml my part of variables i can see my debug message. </p>