mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
The class «Entity» was not found in the chain configured namespaces in production mode #6716
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @marcelkorpel on GitHub (May 12, 2021).
For a project I use separate databases and entity managers using Symfony 5.2.7 and Doctrine ORM 2.8.2. My
doctrine.yamllooks like(only one database and entity manager is currently used, but this is to be extended in the future).
When I try to get the repository class of an entity within a controller using
everything is fine, regardless of in which mode Symfony runs.
However, when trying to get that class from an autowired entity manager within a generic (service) class, like
Symfony outputs a 500 error when running in production mode and writes
to
/srv/http/myproject/var/log/prod.log.For the record, the service class is also autowired in the controller method:
Everything works as expected, no error is thrown or output in
dev.log, whenAPP_ENV=dev.