Dependency on non-existent service "doctrine.orm.default_entity_manager"

I use JMSPaymentCoreBundle and JMSPaymentPaypalBundle.

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

I need 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 change.

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

this error occurs.

I think changes to config.yml are causing this problem.

How can I solve this problem?

+4
source share
1 answer

According to the error, you need to define an object manager named default . In your case, the general syntax is simply incorrect, see My example.

In config.yml:

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

I would advise you to read the documentation on "Databases and Doctrine" and "How to work with multiple managers and object connections"

+5
source

Source: https://habr.com/ru/post/1502305/


All Articles