私のsymfony2 projetは開発環境で完璧に動作します。この問題は、本番環境に切り替えるときに発生します。エンティティの配列を持つコントローラを呼び出して、JSMserializerでjsonにシリアル化すると、クラッシュします。クライアントは依然として応答を受信しますが、jsonは空であり、 "[]"さえありません。私は、ログに見てみるとき、私はこれらのエラーを読むことができます:symfony2 projetがJSMserializerbundleとDoctrineMongoDBBundleで動作しない
security.INFO: Populated SecurityContext with an anonymous Token [] []
request.INFO: Matched route "employe_index" (parameters: "_controller": "Pisteur\WebRefugeManager\Bundle\CoreBundle\Controller\EmployeController::indexAction", "_route": "employe_index") [] []
request.CRITICAL: Doctrine\Common\Annotations\AnnotationException: [Semantical Error] The annotation "@proxy" in method Doctrine\MongoDB\Cursor::current() was never imported. Did you maybe forget to add a "use" statement for this annotation? (uncaught exception) at /home/wpdemo/symfony/vendor/doctrine-common/lib/Doctrine/Common/Annotations/AnnotationException.php line 52 [] []
私はグーグルのエラーを検索したと私は、これら二つのトピックが見つかりました:これらのトピックはdidnの
https://github.com/doctrine/mongodb-odm/issues/255 https://github.com/schmittjoh/JMSSerializerBundle/issues/51
を私を助けて、私は本当に問題を理解していない。誰でもアイデアがありますか?
ここで[EDIT] は私のconfigsです:
DEV:
imports:
- { resource: config.yml }
framework:
router: { resource: "%kernel.root_dir%/config/routing_dev.yml" }
profiler: { only_exceptions: false }
web_profiler:
toolbar: true
intercept_redirects: false
monolog:
handlers:
main:
type: stream
path: %kernel.logs_dir%/%kernel.environment%.log
level: debug
firephp:
type: firephp
level: info
assetic:
use_controller: true
PROD:
imports:
- { resource: config.yml }
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
nested:
type: stream
path: %kernel.logs_dir%/%kernel.environment%.log
level: debug
[EDIT]
これは、私が実行したコマンドであります:
php app/console cache:clear --env=prod --no-debug
php app/console cache:warmup
php app/console assets:install web
php app/console assetic:dump web --env=prod --no-debug
2つの環境の間でどのような設定の違いがありますか?特定のメタデータキャッシュドライバを有効にしましたか? – Florian
私はちょうどあなたのアプリ/キャッシュをクリアしようとした –
私の設定を投稿した? – Sethunath