{"action":"created","issue":{"url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle/issues/368","labels_url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle/issues/368/labels{/name}","comments_url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle/issues/368/comments","events_url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle/issues/368/events","html_url":"https://github.com/schmittjoh/JMSSerializerBundle/issues/368","id":28193416,"number":368,"title":"ServiceNotFoundException: You have requested a non-existent service \\\"serializer\\\"","user":{"login":"jesmarquez","id":6026337,"avatar_url":"https://avatars.githubusercontent.com/u/6026337?v=3","gravatar_id":"","url":"https://api.github.com/users/jesmarquez","html_url":"https://github.com/jesmarquez","followers_url":"https://api.github.com/users/jesmarquez/followers","following_url":"https://api.github.com/users/jesmarquez/following{/other_user}","gists_url":"https://api.github.com/users/jesmarquez/gists{/gist_id}","starred_url":"https://api.github.com/users/jesmarquez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jesmarquez/subscriptions","organizations_url":"https://api.github.com/users/jesmarquez/orgs","repos_url":"https://api.github.com/users/jesmarquez/repos","events_url":"https://api.github.com/users/jesmarquez/events{/privacy}","received_events_url":"https://api.github.com/users/jesmarquez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-02-24T20:28:15Z","updated_at":"2015-01-24T19:37:03Z","closed_at":null,"body":"Because I'm getting the following error: \r\n\r\nServiceNotFoundException: \"You have requested a non-existent service \"serializer\".\" at C:\\wamp\\www\\symensay\\app\\bootstrap.php.cache line 1967 {\"exception\":\"[object] (Symfony\\\\Component\\\\DependencyInjection\\\\Exception\\\\ServiceNotFoundException: You have requested a non-existent service \\\"serializer\\\". at C:\\\\wamp\\\\www\\\\symensay\\\\app\\\\bootstrap.php.cache:1967)\r\n\r\nInstall the component as indicated in the documentation!\r\n\r\nin the controller i have:\r\n...\r\nuse JMS\\SerializerBundle\\Serializer\\Serializer;\r\n...\r\n\r\n$usuarios = $query->getResult();\r\n$serializer = $this->container->get('serializer');\r\n$entityserializer= $serializer->serialize($usuarios, 'json');\r\n\r\n\r\nThank!"},"comment":{"url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle/issues/comments/71333725","html_url":"https://github.com/schmittjoh/JMSSerializerBundle/issues/368#issuecomment-71333725","issue_url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle/issues/368","id":71333725,"user":{"login":"theofidry","id":5175937,"avatar_url":"https://avatars.githubusercontent.com/u/5175937?v=3","gravatar_id":"","url":"https://api.github.com/users/theofidry","html_url":"https://github.com/theofidry","followers_url":"https://api.github.com/users/theofidry/followers","following_url":"https://api.github.com/users/theofidry/following{/other_user}","gists_url":"https://api.github.com/users/theofidry/gists{/gist_id}","starred_url":"https://api.github.com/users/theofidry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theofidry/subscriptions","organizations_url":"https://api.github.com/users/theofidry/orgs","repos_url":"https://api.github.com/users/theofidry/repos","events_url":"https://api.github.com/users/theofidry/events{/privacy}","received_events_url":"https://api.github.com/users/theofidry/received_events","type":"User","site_admin":false},"created_at":"2015-01-24T19:37:03Z","updated_at":"2015-01-24T19:37:03Z","body":"Depending of the context, you can try `$this->get('serializer')`instead of `$this->container->get('serializer')`.\r\n\r\nIf you're in a service, you have to **inject** the service `serializer`, cf. [this link](http://symfony.com/doc/current/components/dependency_injection/types.html)."}}