title: ServiceNotFoundException in CheckExceptionOnInvalidReferenceBehaviorPass.php line 58 The service "app.admin.page" has a dependency
body: <p>When I go to url: <a href="http://localhost/symfony2/p1/web/app_dev.php/sonata/dashboard" rel="nofollow">http://localhost/symfony2/p1/web/app_dev.php/sonata/dashboard</a> I get the error: </p>
  
  <blockquote>
    <p>ServiceNotFoundException in CheckExceptionOnInvalidReferenceBehaviorPass.php line 58: The service "app.admin.page" has a dependency on a non-existent service "sonata.admin.route.path_info_slashes".</p>
  </blockquote>
  
  <p>routing.yml</p>
  
  <pre><code>admin_area:
  resource: "@SonataAdminBundle/Resources/config/routing/sonata_admin.xml"
  prefix: /sonata
  
  cmf_routing:
  # ...
  dynamic:
      # ...
      persistence:
          phpcr:
              # ...
              use_sonata_admin: false
  </code></pre>
  
  <p>services.yml</p>
  
  <pre><code>services:
  app.admin.page:
      class: BrazBundle\Sonata\PageAdmin
      arguments:
          - ''
          - BrazBundle\Document\Page
          - 'SonataAdminBundle:CRUD'
      tags:
          - { name: sonata.admin, manager_type: doctrine_phpcr, group: 'Basic CMS', label: Page }
      calls:
          - [setRouteBuilder, ['@sonata.admin.route.path_info_slashes']]
  app.admin.post:
      class: BrazBundle\Sonata\PostAdmin
      arguments:
          - ''
          - BrazBundle\Document\Post
          - 'SonataAdminBundle:CRUD'
      tags:
          - { name: sonata.admin, manager_type: doctrine_phpcr, group: 'Basic CMS', label: 'Blog Posts' }
      calls:
          - [setRouteBuilder, ['@sonata.admin.route.path_info_slashes']]
  </code></pre>
  
  <p>config.yml</p>
  
  <pre><code># app/config/config.yml
  sonata_block:
  default_contexts: [cms]
  blocks:
      # enable the SonataAdminBundle block
      sonata.admin.block.admin_list:
          contexts: [admin]
      # ...
  </code></pre>
  
  <p>PageAdmin.php</p>
  
  <pre><code>&lt;?php
  
  namespace BrazBundle\Sonata;
  
  use Sonata\DoctrinePHPCRAdminBundle\Admin\Admin;
  use Sonata\AdminBundle\Datagrid\DatagridMapper;
  use Sonata\AdminBundle\Datagrid\ListMapper;
  use Sonata\AdminBundle\Form\FormMapper;
  
  class PageAdmin extends Admin
  {
  protected function configureListFields(ListMapper $listMapper)
  {
      $listMapper
          -&gt;addIdentifier('title', 'text')
      ;
  }
  
  protected function configureFormFields(FormMapper $formMapper)
  {
      $formMapper
          -&gt;with('form.group_general')
              -&gt;add('title', 'text')
              -&gt;add('content', 'textarea')
          -&gt;end()
      ;
  }
  
  public function prePersist($document)
  {
      $parent = $this-&gt;getModelManager()-&gt;find(null, '/cms/pages');
      $document-&gt;setParentDocument($parent);
  }
  
   protected function configureDatagridFilters(DatagridMapper $datagridMapper)
  {
      $datagridMapper-&gt;add('title', 'doctrine_phpcr_string');
  }
  
  public function getExportFormats()
  {
      return array();
  }
  }
  
  
  &lt;?php
  
  namespace BrazBundle\Sonata;
  
  use Sonata\DoctrinePHPCRAdminBundle\Admin\Admin;
  use Sonata\AdminBundle\Datagrid\DatagridMapper;
  use Sonata\AdminBundle\Datagrid\ListMapper;
  use Sonata\AdminBundle\Form\FormMapper;
  
  class PostAdmin extends PageAdmin
  {
  protected function configureFormFields(FormMapper $formMapper)
  {
      parent::configureFormFields($formMapper);
  
      $formMapper
          -&gt;with('form.group_general')
              -&gt;add('date', 'date')
          -&gt;end()
      ;
  }
  }
  </code></pre>
  
  <p>AppKernal.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 Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
          new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
          new AppBundle\AppBundle(),
          new BrazBundle\BrazBundle(),
          new My\FrontendBundle\MyFrontendBundle(),
  
          new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
          new FOS\UserBundle\FOSUserBundle(),
          new UserBundle\UserBundle(),
  
          // These are the other bundles the SonataAdminBundle relies on          
          new Sonata\CoreBundle\SonataCoreBundle(),
          new Sonata\BlockBundle\SonataBlockBundle(),
          new Knp\Bundle\MenuBundle\KnpMenuBundle(),
          // And finally, the storage and SonataAdminBundle
          new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
          new Sonata\AdminBundle\SonataAdminBundle(),
          //new CMSBundle\CMSBundle(),
      );
  
      if (in_array($this-&gt;getEnvironment(), array('dev', 'test'), true)) {
          $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
          $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($this-&gt;getRootDir().'/config/config_'.$this-&gt;getEnvironment().'.yml');
  }
  }
  </code></pre>