Reputation: 1451
I'm learning Symfony2 and I use Doctrine2 as ORM. Everything went fine except one error. In fact this error is blocking me because she happens on every page and in the CLI too.
The error is the following:
ErrorException: Warning: class_parents(): Class BumpMe\UserBundle\Entity\User does not exist and could not be loaded in /home/gp2mv3/www/bumpme/vendor/doctrine/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php line 223
The User Entity was in the UserBundle but i moved it (the files) in another bundle (AppBundle). I renamed the file and the namespaces in it. After that i removed the UserBundle without errors.
And now, after a lot of cli commands, I've it...
How can i solve this issue ? Where does this error come from ?
Thanks.
Upvotes: 1
Views: 4796
Reputation: 1451
I found the error !
I forgot one declaration in app/config/config.yml
.
If you've the same error, reread every file and you'll probably find an old unedited statement.
# app/config/config.yml
fos_user:
db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel'
firewall_name: main
# Allows you to enter the new user entity
user_class: MyApp\Bundle\UserBundle\Entity\User
# Used to enter the new registration form
registration:
form:
type: myapp_user_registrationform
Upvotes: 1
Reputation: 356
A bit outdated, but I just come across same error, so checked config.yml (which I was editing according to 'install'), and here it is, in last line: 'Acme' user load, maybe this help someone:
fos_user:
db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel'
firewall_name: main
user_class: Acme\UserBundle\Entity\User
Upvotes: 0
Reputation: 11
I also had this error.
I had an old /Resources/config/doctrine/User.orm.yml
file lurking from when I moved my user from my MainBundle to it's own UserBundle (using annotations)
Upvotes: 1