I am following the book and on the page http://symfony.com/doc/current/book/doctrine.html
While following the book I am trying to work on relationship of product and cat
This error will also come up if your projects (only?) Entity is namespaced incorrectly. If you run the command
$ php app/console doctrine:generate:entities MyBundle
and it produces the error
[RuntimeException]
Bundle "MyBundle" does not contain any mapped entities.
Check the more specific command....
$ php app/console doctrine:generate:entities MyBundle:MyEntity
And see if you get the error:
[RuntimeException]
The autoloader expected class "MyBundle\Entity\MyEntity" to be defined in file "/path/to/MyBundle/Entity/MyEntity.php". The file was found but the class was not in it, the class name or namespace probably has a typo.
If so, well then, the error speaks for itself (hopefully) and the namespace/class name needs to be corrected. Hopefully that is helpful to someone.