0

プロジェクトで Symfony-CMF を使用して Sonata Admin をセットアップしようとしていますが、メニュー項目を追加しようとするとエラーが発生します。

これを修正する方法は?

エラー:

クラス 'Symfony\Cmf\Bundle\MenuBundle\Document\MenuItem' はチェーン構成された名前空間 Doctrine\ODM\PHPCR\Document で見つかりませんでした

ログ:

DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelRequest". 
DEBUG - Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\SessionListener::onKernelRequest". 
DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest". 
DEBUG - SET NAMES UTF8 
DEBUG - SELECT t0.id AS id1, t0.name AS name2, t0.billing_address AS billing_address3, t0.contact_name AS contact_name4, t0.contact_email_address AS contact_email_address5, t0.contact_phone_number AS contact_phone_number6 FROM client t0 
DEBUG - SELECT t0.id AS id1, t0.name AS name2, t0.billing_address AS billing_address3, t0.contact_name AS contact_name4, t0.contact_email_address AS contact_email_address5, t0.contact_phone_number AS contact_phone_number6 FROM client t0 
INFO - Matched route "admin_bundle_menu_menuitem_create" (parameters: "_controller": "Sonata\AdminBundle\Controller\CRUDController::createAction", "_sonata_admin": "symfony_cmf_menu.admin", "_sonata_name": "admin_bundle_menu_menuitem_create", "_route": "admin_bundle_menu_menuitem_create") 
DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest". 
DEBUG - Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest". 
DEBUG - Read SecurityContext from the session 
DEBUG - Reloading user from user provider. 
DEBUG - SELECT t1.username AS username2, t1.username_canonical AS username_canonical3, t1.email AS email4, t1.email_canonical AS email_canonical5, t1.enabled AS enabled6, t1.salt AS salt7, t1.password AS password8, t1.last_login AS last_login9, t1.locked AS locked10, t1.expired AS expired11, t1.expires_at AS expires_at12, t1.confirmation_token AS confirmation_token13, t1.password_requested_at AS password_requested_at14, t1.roles AS roles15, t1.credentials_expired AS credentials_expired16, t1.credentials_expire_at AS credentials_expire_at17, t1.id AS id18, t1.fb_uid AS fb_uid19, t1.tw_uid AS tw_uid20, t0.categorySelectFlag AS categorySelectFlag21, t0.paypalName AS paypalName22, t1.type FROM seeder t0 INNER JOIN user t1 ON t0.id = t1.id WHERE t1.id = ? LIMIT 1 
DEBUG - SELECT t1.username AS username2, t1.username_canonical AS username_canonical3, t1.email AS email4, t1.email_canonical AS email_canonical5, t1.enabled AS enabled6, t1.salt AS salt7, t1.password AS password8, t1.last_login AS last_login9, t1.locked AS locked10, t1.expired AS expired11, t1.expires_at AS expires_at12, t1.confirmation_token AS confirmation_token13, t1.password_requested_at AS password_requested_at14, t1.roles AS roles15, t1.credentials_expired AS credentials_expired16, t1.credentials_expire_at AS credentials_expire_at17, t1.id AS id18, t1.fb_uid AS fb_uid19, t1.tw_uid AS tw_uid20, t0.client_id AS client_id21, t1.type FROM manager t0 INNER JOIN user t1 ON t0.id = t1.id WHERE t1.id = ? LIMIT 1 
DEBUG - Username "admin" was reloaded from user provider. 
DEBUG - Notified event "kernel.request" to listener "Doctrine\Bundle\PHPCRBundle\EventListener\LocaleListener::onKernelRequest". 
DEBUG - Notified event "kernel.request" to listener "Symfony\Bundle\AsseticBundle\EventListener\RequestListener::onKernelRequest". 
DEBUG - Notified event "kernel.request" to listener "MyProject\MyBundle\Listener\Kernel::onKernelRequest". 
DEBUG - Notified event "kernel.controller" to listener "Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector::onKernelController". 
DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener::onKernelController". 
DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener::onKernelController". 
DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernelController". 
DEBUG - Notified event "kernel.controller" to listener "Acme\DemoBundle\EventListener\ControllerListener::onKernelController". 
DEBUG - Notified event "kernel.controller" to listener "Symfony\Component\HttpKernel\DataCollector\RequestDataCollector::onKernelController". 
DEBUG - Notified event "kernel.exception" to listener "Symfony\Component\Security\Http\Firewall\ExceptionListener::onKernelException". 
DEBUG - Notified event "kernel.exception" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelException". 
DEBUG - Notified event "kernel.exception" to listener "Symfony\Component\HttpKernel\EventListener\ExceptionListener::onKernelException". 
CRITICAL - Doctrine\Common\Persistence\Mapping\MappingException: The class 'Symfony\Cmf\Bundle\MenuBundle\Document\MenuItem' was not found in the chain configured namespaces Doctrine\ODM\PHPCR\Document (uncaught exception) at /var/www/likeseed/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php line 38 
DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelRequest". 
DEBUG - Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\SessionListener::onKernelRequest". 
DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest". 
DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest". 
DEBUG - Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest". 
DEBUG - Notified event "kernel.request" to listener "Doctrine\Bundle\PHPCRBundle\EventListener\LocaleListener::onKernelRequest". 
DEBUG - Notified event "kernel.request" to listener "Symfony\Bundle\AsseticBundle\EventListener\RequestListener::onKernelRequest". 
DEBUG - Notified event "kernel.request" to listener "MyProject\MyBundle\Listener\Kernel::onKernelRequest". 
DEBUG - Notified event "kernel.controller" to listener "Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector::onKernelController". 
DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener::onKernelController". 
DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener::onKernelController". 
DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernelController". 
DEBUG - Notified event "kernel.controller" to listener "Acme\DemoBundle\EventListener\ControllerListener::onKernelController". 
DEBUG - Notified event "kernel.controller" to listener "Symfony\Component\HttpKernel\DataCollector\RequestDataCollector::onKernelController". 
4

2 に答える 2

2

config.yml の doctrine_phpcr 部分にこれを追加しました:

odm:
    auto_mapping: true

そして今、それはうまくいきます。

于 2012-08-21T09:59:39.053 に答える
0

エラーはそれ自体を説明します。不足しているMenuItemクラスを探して、正しい名前空間に配置する必要があると思います

于 2012-08-20T07:00:32.657 に答える