我使用FOSUserBundle:

我的用户实体扩展了FOS \ UserBundle \ Model \ User:

在我的包中,我创建了用户yml文件:

MyApp\EntityBundle\Entity\User:
type:  entity
repositoryClass: MyApp\EntityBundle\Repository\UserRepository
table: fos_user
id:
    id:
        type: integer
        generator:
            strategy: AUTO
oneToOne:
    college:
      targetEntity: College
      mappedBy: user

这会引发以下异常:

ContextErrorException:警告:simplexml_load_file():I / O警告:无法加载外部实体“E:\ xampp \ htdocs \ myproject \ vendor \ friendsofsymfony \ user-bundle \ FOS \ UserBundle \ Resources \ config \ doctrine \ model / User .orm.xml“在E:\ xampp \ htdocs \ myproject \ vendor \ doctrine \ orm \ lib \ Doctrine \ ORM \ Mapping \ Driver \ XmlDriver.php第732行

MappingException:类'FOS \ UserBundle \ Model \ User'的映射文件'FOS.UserBundle.Model.User.orm.xml'无效 .

什么可能出错?