Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2074

ManyToManyPersister not found in the chain configured namespaces

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.3
    • Fix Version/s: 2.3.1
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None
    • Environment:
      Symfony 2.1

      Description

      The error is: "The class 'Doctrine\ORM\Persisters\ManyToManyPersister' was not found in the chain configured namespaces"

      Replicate by making an entity which has a property which is self referencing; e.g. http://docs.doctrine-project.org/en/latest/reference/association-mapping.html#many-to-many-self-referencing .

      For example an Album could be related to any other similar albums. An album entity would have a property 'relatedAlbums' which is an ArrayCollection. Similarly, I could be working on a CMS where any piece of content could be related to any other in order to show a "related content" or "related posts" style list on a web page.

      Using Symfony 2.1 and a Symfony Form with FormBuilder make sure to use the 'by_reference' => false to call the setter for the property. In the setter for the property: https://gist.github.com/3879169

      A similar question has been asked on StackOverflow: http://stackoverflow.com/questions/12077084/doctrine2-manytomany-self-referencing

        Activity

        Hide
        Benjamin Eberlei added a comment -

        I need a stacktrace for this error, i have no clue why this happens and where.

        Show
        Benjamin Eberlei added a comment - I need a stacktrace for this error, i have no clue why this happens and where.
        Hide
        Steffan Harries added a comment -

        Stack Trace:

        The class 'Doctrine\ORM\Persisters\ManyToManyPersister' was not found in the chain configured namespaces Gedmo\Tree\Entity, Gedmo\Translatable\Entity, MyProject\Bundle\AdminBundle\Entity, MyProject\Bundle\Common\SiteBundle\Entity, MyProject\Bundle\Common\ContentBundle\Entity, FOS\UserBundle\Entity

        500 Internal Server Error - MappingException

        Stack Trace

        in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php at line 38
        */
        public static function classNotFoundInNamespaces($className, $namespaces)

        { return new self("The class '" . $className . "' was not found in the ". "chain configured namespaces " . implode(", ", $namespaces)); }

        at MappingException ::classNotFoundInNamespaces ('Doctrine\ORM\Persisters\ManyToManyPersister', array('Gedmo\Tree\Entity', 'Gedmo\Translatable\Entity', 'MyProject\Bundle\AdminBundle\Entity', 'MyProject\Bundle\Common\SiteBundle\Entity', 'MyProject\Bundle\Common\ContentBundle\Entity', 'FOS\UserBundle\Entity'))
        in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php at line 114
        at MappingDriverChain ->loadMetadataForClass ('Doctrine\ORM\Persisters\ManyToManyPersister', object(ClassMetadata))
        in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php at line 112
        at ClassMetadataFactory ->doLoadMetadata (object(ClassMetadata), null, false, array())
        in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php at line 302
        at AbstractClassMetadataFactory ->loadMetadata ('Doctrine\ORM\Persisters\ManyToManyPersister')
        in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php at line 205
        at AbstractClassMetadataFactory ->getMetadataFor ('Doctrine\ORM\Persisters\ManyToManyPersister')
        in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php at line 268
        at EntityManager ->getClassMetadata ('Doctrine\ORM\Persisters\ManyToManyPersister')
        in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php at line 169
        at ManyToManyPersister ->_getDeleteSQL (object(PersistentCollection))
        in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/AbstractCollectionPersister.php at line 89
        at AbstractCollectionPersister ->delete (object(PersistentCollection))
        in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php at line 328
        at UnitOfWork ->commit (null)
        in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php at line 355
        at EntityManager ->flush (null)
        in kernel.root_dir/cache/dev/jms_diextra/doctrine/EntityManager_5075974d574d6.php at line 362
        at EntityManager ->flush ()
        in /opt/local/apache2/htdocs/projects/my-project/src/MyProjectBundle/Common/ContentBundle/Controller/ContentController.php at line 170
        at ContentController ->updateAction (object(Request), '3')
        at call_user_func_array (array(object(ContentController), 'updateAction'), array(object(Request), '3'))
        in kernel.root_dir/bootstrap.php.cache at line 1421
        at HttpKernel ->handleRaw (object(Request), '1')
        in kernel.root_dir/bootstrap.php.cache at line 1385
        at HttpKernel ->handle (object(Request), '1', true)
        in kernel.root_dir/bootstrap.php.cache at line 1561
        at HttpKernel ->handle (object(Request), '1', true)
        in kernel.root_dir/bootstrap.php.cache at line 612
        at Kernel ->handle (object(Request))
        in /opt/local/apache2/htdocs/projects/my-project/web/app_dev.php at line 28

        Show
        Steffan Harries added a comment - Stack Trace: The class 'Doctrine\ORM\Persisters\ManyToManyPersister' was not found in the chain configured namespaces Gedmo\Tree\Entity, Gedmo\Translatable\Entity, MyProject\Bundle\AdminBundle\Entity, MyProject\Bundle\Common\SiteBundle\Entity, MyProject\Bundle\Common\ContentBundle\Entity, FOS\UserBundle\Entity 500 Internal Server Error - MappingException Stack Trace in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php at line 38 */ public static function classNotFoundInNamespaces($className, $namespaces) { return new self("The class '" . $className . "' was not found in the ". "chain configured namespaces " . implode(", ", $namespaces)); } at MappingException ::classNotFoundInNamespaces ('Doctrine\ORM\Persisters\ManyToManyPersister', array('Gedmo\Tree\Entity', 'Gedmo\Translatable\Entity', 'MyProject\Bundle\AdminBundle\Entity', 'MyProject\Bundle\Common\SiteBundle\Entity', 'MyProject\Bundle\Common\ContentBundle\Entity', 'FOS\UserBundle\Entity')) in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php at line 114 at MappingDriverChain ->loadMetadataForClass ('Doctrine\ORM\Persisters\ManyToManyPersister', object(ClassMetadata)) in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php at line 112 at ClassMetadataFactory ->doLoadMetadata (object(ClassMetadata), null, false, array()) in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php at line 302 at AbstractClassMetadataFactory ->loadMetadata ('Doctrine\ORM\Persisters\ManyToManyPersister') in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php at line 205 at AbstractClassMetadataFactory ->getMetadataFor ('Doctrine\ORM\Persisters\ManyToManyPersister') in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php at line 268 at EntityManager ->getClassMetadata ('Doctrine\ORM\Persisters\ManyToManyPersister') in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php at line 169 at ManyToManyPersister ->_getDeleteSQL (object(PersistentCollection)) in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/AbstractCollectionPersister.php at line 89 at AbstractCollectionPersister ->delete (object(PersistentCollection)) in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php at line 328 at UnitOfWork ->commit (null) in /opt/local/apache2/htdocs/projects/my-project/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php at line 355 at EntityManager ->flush (null) in kernel.root_dir/cache/dev/jms_diextra/doctrine/EntityManager_5075974d574d6.php at line 362 at EntityManager ->flush () in /opt/local/apache2/htdocs/projects/my-project/src/MyProjectBundle/Common/ContentBundle/Controller/ContentController.php at line 170 at ContentController ->updateAction (object(Request), '3') at call_user_func_array (array(object(ContentController), 'updateAction'), array(object(Request), '3')) in kernel.root_dir/bootstrap.php.cache at line 1421 at HttpKernel ->handleRaw (object(Request), '1') in kernel.root_dir/bootstrap.php.cache at line 1385 at HttpKernel ->handle (object(Request), '1', true) in kernel.root_dir/bootstrap.php.cache at line 1561 at HttpKernel ->handle (object(Request), '1', true) in kernel.root_dir/bootstrap.php.cache at line 612 at Kernel ->handle (object(Request)) in /opt/local/apache2/htdocs/projects/my-project/web/app_dev.php at line 28
        Hide
        Benjamin Eberlei added a comment -

        Ok apparently this is fixed

        Show
        Benjamin Eberlei added a comment - Ok apparently this is fixed

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Steffan Harries
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: