在制作中我遇到了这个错误:
The class 'Generic\UserBundle\Entity\Session' was not found in the chain configured namespaces
使用php app/console doctrine:mapping:info
检查我的实体时,这就是我得到的
Found 18 mapped entities:
[OK] App\AdminBundle\Entity\ArticleOpen
[OK] App\AdminBundle\Entity\ModuleQuote
[OK] App\AdminBundle\Entity\Comment
[OK] App\AdminBundle\Entity\ModuleVideo
[OK] App\AdminBundle\Entity\ModuleGallery
[OK] App\AdminBundle\Entity\ArticlesUsers
[OK] App\AdminBundle\Entity\ModuleText
[OK] App\AdminBundle\Entity\User
[OK] App\AdminBundle\Entity\Story
[OK] App\AdminBundle\Entity\ModuleTitle
[OK] App\AdminBundle\Entity\ModuleGalleryPicture
[OK] App\AdminBundle\Entity\ModulePicture
[OK] App\AdminBundle\Entity\Category
[OK] App\AdminBundle\Entity\Group
[OK] App\AdminBundle\Entity\Article
[OK] Generic\UserBundle\Entity\Session
[OK] FOS\UserBundle\Model\User
[OK] FOS\UserBundle\Model\Group
Found 17 mapped entities:
[OK] App\AdminBundle\Entity\ModulePicture
[OK] App\AdminBundle\Entity\Group
[OK] App\AdminBundle\Entity\ArticlesUsers
[OK] App\AdminBundle\Entity\Story
[OK] App\AdminBundle\Entity\ModuleTitle
[OK] App\AdminBundle\Entity\Category
[OK] App\AdminBundle\Entity\ArticleOpen
[OK] App\AdminBundle\Entity\ModuleQuote
[OK] App\AdminBundle\Entity\Article
[OK] App\AdminBundle\Entity\ModuleGalleryPicture
[OK] App\AdminBundle\Entity\Comment
[OK] App\AdminBundle\Entity\ModuleGallery
[OK] App\AdminBundle\Entity\ModuleVideo
[OK] App\AdminBundle\Entity\ModuleText
[OK] App\AdminBundle\Entity\User
[OK] FOS\UserBundle\Model\User
[OK] FOS\UserBundle\Model\Group
正如您所见,生产中缺少实体Generic\UserBundle\Entity\Session
。我已经检查过捆绑包是在appKernel中注册的,而不是在'dev'部分下面。我还检查了一些文件/文件夹中包含区分大小写内容的拼写错误的路径,但一切似乎都很好。
另一个值得一提的事实是,我手动从另一个项目中复制了这个包,我没有使用控制台来生成它,所以我可能忘记了一些东西。缺少的实体是该捆绑包上唯一的实体,因此整个捆绑包可能不仅仅是这个实体(但同时它如何在开发模式下工作?)
谢谢