title: Non-existent service in FOSUserBundle's controller override
body: <p>I am trying to override FOSUserBundle's <code>RegistrationController</code>. I've followed <a href="https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Resources/doc/overriding_controllers.md" rel="nofollow">the documentation</a> and could get Symfony to use my controller instead, but I am getting this error when its <code>registerAction</code> method is called:</p>
  
  <pre><code>You have requested a non-existent service "fos_user.registration.form"
  </code></pre>
  
  <p>I modified the <code>DependencyInjection\Configuration</code> class to match the original one but the services don't seem to be added. FOSUserBundle's documentation doesn't say anything about this, so I don't know how to set it up properly.</p>
  
  <p>Here are my files:</p>
  
  <p><strong>RegistrationController.php</strong></p>
  
  <pre><code>namespace ACME\AuthBundle\Controller;
  
  use Symfony\Component\HttpFoundation\RedirectResponse;
  use FOS\UserBundle\Controller\RegistrationController as BaseController;
  use Symfony\Component\HttpFoundation\Request;
  
  class RegistrationController extends BaseController
  {
    public function registerAction(Request $request)
    {
      $form = $this-&gt;container-&gt;get('fos_user.registration.form'); // Source of error
      ...
    }
  }
  </code></pre>
  
  <p><strong>Configuration.php</strong></p>
  
  <pre><code>namespace ACME\AuthBundle\DependencyInjection;
  
  use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  use Symfony\Component\Config\Definition\ConfigurationInterface;
  
  class Configuration implements ConfigurationInterface
  {
      public function getConfigTreeBuilder()
      {
          $treeBuilder = new TreeBuilder();
          $rootNode = $treeBuilder-&gt;root('fos_user');
  
          $rootNode
              -&gt;children()
                  -&gt;arrayNode('registration')
                      -&gt;addDefaultsIfNotSet()
                      -&gt;canBeUnset()
                      -&gt;children()
                          -&gt;arrayNode('confirmation')
                              -&gt;addDefaultsIfNotSet()
                              -&gt;children()
                                  -&gt;booleanNode('enabled')-&gt;defaultFalse()-&gt;end()
                                  -&gt;scalarNode('template')-&gt;defaultValue('FOSUserBundle:Registration:email.txt.twig')-&gt;end()
                                  -&gt;arrayNode('from_email')
                                      -&gt;canBeUnset()
                                      -&gt;children()
                                          -&gt;scalarNode('address')-&gt;isRequired()-&gt;cannotBeEmpty()-&gt;end()
                                          -&gt;scalarNode('sender_name')-&gt;isRequired()-&gt;cannotBeEmpty()-&gt;end()
                                      -&gt;end()
                                  -&gt;end()
                              -&gt;end()
                          -&gt;end()
                          -&gt;arrayNode('form')
                              -&gt;addDefaultsIfNotSet()
                              -&gt;children()
                                  -&gt;scalarNode('type')-&gt;defaultValue('fos_user_registration')-&gt;end()
                                  -&gt;scalarNode('name')-&gt;defaultValue('fos_user_registration_form')-&gt;end()
                                  -&gt;arrayNode('validation_groups')
                                      -&gt;prototype('scalar')-&gt;end()
                                      -&gt;defaultValue(array('Registration', 'Default'))
                                  -&gt;end()
                              -&gt;end()
                          -&gt;end()
                      -&gt;end()
                  -&gt;end()
              -&gt;end();
  
          return $treeBuilder;
      }
  }
  </code></pre>