Symfony 5.1.3在清除缓存时出现问题:尝试加载类“ MappingDriverChain”。来自命名空间 [英] Symfony 5.1.3 Issue while clearing the cache: Attempted to load class "MappingDriverChain" from namespace

查看:166
本文介绍了Symfony 5.1.3在清除缓存时出现问题:尝试加载类“ MappingDriverChain”。来自命名空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将我的symfony应用程序更新为 5.1.3 。但是从那以后,在清除缓存上就缺少了一个类。

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"?    

我已经检查了缓存文件,而symfony确实在缓存上请求了此类。从其他一些帖子中,我得到了教义结构已经改变的印象。在所有必须进行此更改的存储库类上,我也遇到了类似的问题

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

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

关于相同问题,我也看到过类似的帖子,说更新到最新版本将解决问题。但是对于我而言,这并不成功。

是symfony版本的问题还是其他一些配置问题。 MySQL的。不确定是否与问题有关。

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.

这是我当前的 composer.json & composer.lock

This is my current composer.json & composer.lock

推荐答案

我找到了解决该问题的方法。在作曲家更新时,原则/持久性已更新为 V2.0.0 & 教义/通用 V3.0.2 。而且我认为这两个版本尚未与 symfony / orm V2.0 兼容,因此我不得不降级了理论版本以使应用程序正常运行

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

现在该应用程序在symfony 5.1.3中正常运行。

如果由于降级而出现任何问题,将进行更新。

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

这篇关于Symfony 5.1.3在清除缓存时出现问题:尝试加载类“ MappingDriverChain”。来自命名空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆