你能幫忙解決下面的錯誤?Symfony2的FOSREST JMS 串行束錯誤
InvalidArgumentException: "fos_rest.serializer" must implement FOS\RestBundle\Serializer\Serializer (instance of "JMS\Serializer\Serializer" given).
in C:\wamp\www\SymfonyRestAPI\src\FOS\RestBundle\DependencyInjection\Compiler\SerializerConfigurationPass.php line 58
at SerializerConfigurationPass->process(object(ContainerBuilder)) in C:\wamp\www\SymfonyRestAPI\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\Compiler.php line 117
at Compiler->compile(object(ContainerBuilder)) in C:\wamp\www\SymfonyRestAPI\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\ContainerBuilder.php line 613
at ContainerBuilder->compile() in C:\wamp\www\SymfonyRestAPI\app\bootstrap.php.cache line 2502
at Kernel->initializeContainer() in C:\wamp\www\SymfonyRestAPI\app\bootstrap.php.cache line 2281
at Kernel->boot() in C:\wamp\www\SymfonyRestAPI\app\bootstrap.php.cache line 2312
at Kernel->handle(object(Request)) in C:\wamp\www\SymfonyRestAPI\web\app_dev.php line 28
這是過於寬泛。但我認爲你必須添加你的配置文件的代碼。哪個類與「fos_rest.serializer」相關 –
我遵循symfony教程的所有步驟,但始終是相同的錯誤,在appKernel.php文件中我添加了新的FOS \ RestBundle \ FOSRestBundle(), 新的JMS \ SerializerBundle \ JMSSerializerBundle() – Ndb
在composer.json我補充說:「friendsofsymfony /休息束」:「0.11 *」, 「JMS /串行束」:「0.12.x-dev的」,但同樣的錯誤再次 – Ndb