6

I have updated my symfony application to 5.1.3. But since then there is a class missing exception on clearing the cache.

In App_KernelDevDebugContainer.php line 1050:
                                                                               
  Attempted to load class "MappingDriverChain" from namespace "Doctrine\Common\Persistence\Mapping\Driver".                                               
  Did you forget a "use" statement for "Doctrine\Persistence\Mapping\Driver\MappingDriverChain"?    

I have checked the cache file and symfony is indeed requesting for this class on the cache. From some other SO post I got the impression that the doctrine structure have changed. I also had a similar issue on all repository class where I had to make this change

Doctrine\Persistence\ManagerRegistry => Doctrine\Common\Persistence\ManagerRegistry

I have seen a similar SO post regarding the same issue, saying updating to the latest version will solve the issue. But in my case that was not successfully.
Is it an issue with the symfony version or some other configuration issue.
And also I have created two DB connections, both are MySQL. Not sure if this have any connections to the issue.

This is my current composer.json & composer.lock

2
  • Have you found somerthing ? I've got the same problem.
    – conradfr
    Commented Aug 3, 2020 at 15:35
  • @conradfr Can you check my answer, and see if the solution works for you? Commented Aug 3, 2020 at 19:11

2 Answers 2

14

I have found a solution to the issue. On composer update the doctrine/persistence is updated to V2.0.0 & doctrine/common to V3.0.2. And I think these 2 versions are not yet compatible with symfony/orm V2.0 So I had to downgrade the doctrine versions to make the application working again.

composer require doctrine/common:2.13.3 --update-with-dependencies

  - Downgrading doctrine/persistence (2.0.0 => 1.3.7): Loading from cache
  - Downgrading doctrine/common (3.0.2 => 2.13.3): Loading from cache

Now the application is in symfony 5.1.3 and working.
Will update if I come up on any issues due to this downgrade.

1

If you use doctrine-bundle I fixed it by updating it to ^2.0 = 2.5.7.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.