无法找到与 class 的实体关联的对象管理器

Unable to find the object manager associated with an entity of class

我正在开发一个带有 symfony 2.8 和捆绑软件 "FOSUSERBUNDLE" 的应用程序,我的问题是当我尝试注册用户时,我可以看到注册表单,但是在注册时我抛出了以下错误:

Unable to find the object manager associated with an entity of class "Alienigena\ViviendaBundle\Entity\User".

我按照"FOSUSERBUNDLE"的官方教程一步步来的,我的USERclass是:

namespace Alienigena\ViviendaBundle\Entity; 
use FOS\UserBundle\Model\User as BaseUser; 
use Doctrine\ORM\Mapping as ORM;

/**  
* @ORM\Entity  
* @ORM\Table(name="fos_user")  
*/ 
class User extends BaseUser {
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    public function __construct()
    {
        parent::__construct();
        // your own logic
    } 
}

我的问题起源于在使用逆向工程映射 bd 时我使用 xml 中的映射,我应该用注释映射它。 解决方案包括删除使用逆向工程生成的扩展名为 xml 的文件。

谢谢