Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dependency on a non-existent service "doctrine.orm.default_entity_manager"

I am using JMSPaymentCoreBundle and JMSPaymentPaypalBundle.

It worked well before,but now I have to change my config.yml for new Bundle(FOSMessageBundle)

I have to stop using 'auto_mapping' and use 'entity_managers' instead

doctrine:
    dbal:

    orm:
        auto_generate_proxy_classes: %kernel.debug%
#       auto_mapping: true
        entity_managers:
            FOSUserBundle: ~
            FOSMessageBundle: ~

However after this changes .

 The service "payment.plugin_controller" has a dependency on a non-existent service "doctrine.orm.default_entity_manager"

this error happens.

I think changes in config.yml causes this trouble.

How can I solve this problem?

like image 437
whitebear Avatar asked Sep 15 '13 20:09

whitebear


1 Answers

According to the error, you need to define an entity manager named default. In your case, the overall syntax is just wrong, see my example.

In config.yml:

doctrine:
    orm:
        entity_managers:
            default: # that's the name of the entity manager
                connection: default # you need to define the default connection
                mappings: 
                    FOSUserBundle: ~
                    FOSMessageBundle: ~

I'd advise you to read the documentations about "Databases and Doctrine" and "How to work with Multiple Entity Managers and Connections"

like image 150
Thomas Potaire Avatar answered Oct 03 '22 08:10

Thomas Potaire