gpt4 book ai didi

symfony - 类未找到异常 : Attempted to load class "FlattenException" from namespace

转载 作者:行者123 更新时间:2023-12-05 05:26:59 28 4
gpt4 key购买 nike

我正在使用 Symfony 2.4 和 doctrine mongodb bundle 开发一个应用程序。我遇到了一个烦人的错误:

ClassNotFoundException: Attempted to load class "FlattenException" from namespace "Symfony\Component\Debug\Exception" in /opt/apps/aff/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/Cursor.php line 455. Do you need to "use" it from another namespace? Perhaps you need to add a use statement for one of the following: Symfony\Component\HttpKernel\Exception\FlattenException, Symfony\Component\Debug\Exception\FlattenException.

此错误尤其在访问 sonata admin bundle 的列表方法时发生。我在玩存储库类时也遇到过这个错误。

确切的代码在远程服务器上完美运行。但是在本地机器上会发生此错误。我不知道为什么。我在终端上运行了以下代码以查看版本号或 git 提交引用代码。

$ php composer.phar show -i

The result is axactly same on both computers. The following is my composer.json

{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "~2.4",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "~2.3",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~2.3",
"sensio/framework-extra-bundle": "~2.3",
"sensio/generator-bundle": "~2.3",
"incenteev/composer-parameter-handler": "~2.0",

"doctrine/mongodb-odm": "1.0.*@dev",
"doctrine/mongodb-odm-bundle": "3.0.*@dev",
"doctrine/doctrine-fixtures-bundle": "dev-master",

"gedmo/doctrine-extensions": "dev-master",

"jms/serializer-bundle" : "dev-master",

"friendsofsymfony/user-bundle": "*",
"friendsofsymfony/facebook-bundle": "1.2.*@dev",
"friendsofsymfony/rest-bundle" : "dev-master",

"nelmio/api-doc-bundle" : "dev-master",

"sonata-project/core-bundle": "~2.2@dev",
"sonata-project/admin-bundle": "2.2.*@dev",
"sonata-project/doctrine-mongodb-admin-bundle":"dev-master",
"sonata-project/block-bundle": "2.2.*@dev",
"sonata-project/user-bundle": "2.2.3",
"sonata-project/easy-extends-bundle" : "dev-master",
"sonata-project/intl-bundle": "dev-master",

"knplabs/knp-menu-bundle":"1.1.x-dev",
"zeitnot/cp_oauth_client" : "dev-master"


},
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"php app/console assets:install --symlink",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "beta",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"incenteev-parameters": {
"file": "app/config/parameters.yml",
"keep-outdated": true
},
"branch-alias": {
"dev-master": "2.4-dev"
}
}

我真的很迷茫,不知道怎么办。这个烦人的异常是什么意思?

最佳答案

我有同样的事情,错误是由 Cursor.php 中的 hint() 方法中的错误参数类型强制引起的。 PHP 的 PHP 严格标准错误设置为此创建了一个错误。这可能是它在远程服务器上运行良好的原因(不同的 PHP 设置)。

问题现在已解决,因此更新您的 MongoDB 供应商应该可以解决它。 More information

关于symfony - 类未找到异常 : Attempted to load class "FlattenException" from namespace,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22714930/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com