title: Dependency Injection - Symfony (There is no extension able to load the config for "acme_api.question_manager" (in ../Resources/config/services.yml)
body: <p>Getting this error while setting up new services using DI in symfony2
  I am using symfony2.3 and using fos-rest bundle to create json API's</p>
  
  <ul>
  <li>Here is how my code looks like</li>
  </ul>
  
  <p>DependencyInjection/Configuration.php</p>
  
  <pre><code>&lt;?php
  
  namespace Acme\ApiBundle\DependencyInjection;
  
  use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  use Symfony\Component\Config\Definition\ConfigurationInterface;
  
  /**
   * This is the class that validates and merges configuration from your     app/config files
   *
   * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
   */
  class Configuration implements ConfigurationInterface
  {
      /**
       * {@inheritDoc}
       *
       * @return TreeBuilder
       */
      public function getConfigTreeBuilder()
      {
          $treeBuilder = new TreeBuilder();
          $treeBuilder-&gt;root('acmeapi');
  
  
          // Here you should define the parameters that are allowed to
          // configure your bundle. See the documentation linked above for
          // more information on that topic.
  
          return $treeBuilder;
      }
  }
  </code></pre>
  
  <p>DependencyInjection/AcmeApiExtension.php</p>
  
  <pre><code>&lt;?php
  
  namespace Acme\ApiBundle\DependencyInjection;
  
  use Symfony\Component\DependencyInjection\ContainerBuilder;
  use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
  use Symfony\Component\HttpKernel\DependencyInjection\Extension;
  use Symfony\Component\Config\FileLocator;
  
  class AcmeApiExtension extends Extension
  {
      public function load(array $configs, ContainerBuilder $container)
      {
          //$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
          //$loader-&gt;load('services.xml');
  
          $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
          $loader-&gt;load('services.yml');
      }
  
      public function getAlias()
      {
          return 'acme_api';
      }
  }
  </code></pre>
  
  <p>And my Resources/config/services.yml</p>
  
  <pre><code>parameters: 
      # Overriding Security Bundle's Access Listener class to provide  detailed
      # error message
  services:
  acme_api.question_manager:
      class: AcmeApiBundle\Manager\QuestionManager
      arguments:
        - @doctrine
        - @validator
  </code></pre>
  
  <p>And finally the app/confog/config.yml</p>
  
  <pre><code>imports:
      - { resource: parameters.yml }
      - { resource: security.yml }
      - { resource: @AcmeApiBundle/Resources/config/services.yml }
  .......
  </code></pre>
  
  <p>Also, adding the appkernel file</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 Acme\ApiBundle\AcmeApiBundle(),
              new JMS\SerializerBundle\JMSSerializerBundle(),
              new FOS\RestBundle\FOSRestBundle(),
          );
  
          if (in_array($this-&gt;getEnvironment(), array('dev', 'test'))) {
              $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
              $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
              $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
          }
  
          return $bundles;
      }
  
      public function registerContainerConfiguration(LoaderInterface $loader)
      { 
          $loader-&gt;load(__DIR__.'/config/config_'.$this-&gt;getEnvironment().'.yml');
      }
  }
  </code></pre>
  
  <p>Please let me know if any more data points are required, so that its easy to help here.</p>