Symfony 3.4 No Metadata Classes to process Error Symfony 3.4 No Metadata Classes to process Error symfony symfony

Symfony 3.4 No Metadata Classes to process Error


Yes finally i found the issue is with John.orm.php file which will generated when i ran php bin/console doctrine:generate:entity

I have created Entity class using following command

php bin/console doctrine:generate:entity

Then it will prompt to

Welcome to the Doctrine2 entity generatorThis command helps you generate Doctrine2 entities.First, you need to give the entity name you want to generate.You must use the shortcut notation like AcmeBlogBundle:Post.The Entity shortcut name: AppBundle:JohnDetermine the format to use for the mapping information.Configuration format (yml, xml, php, or annotation) [annotation]: phpInstead of starting with a blank entity, you can add some fields now.Note that the primary key will be added automatically (named id).Available types: array, simple_array, json_array, object,boolean, integer, smallint, bigint, string, text, datetime, datetimetz,date, time, decimal, float, binary, blob, guid.New field name (press <return> to stop adding fields): id Field "id" is already defined.New field name (press <return> to stop adding fields): usernameField type [string]: stringField length [255]:Is nullable [false]: trueUnique [false]: falseNew field name (press <return> to stop adding fields): passwordField type [string]:Field length [255]:Is nullable [false]: trueUnique [false]:New field name (press <return> to stop adding fields): dobField type [string]: dateIs nullable [false]: trueUnique [false]:New field name (press <return> to stop adding fields):  Entity generation  created .\src\AppBundle/Entity/John.php  created .\src\AppBundle/Resources/config/doctrine/  created .\src\AppBundle/Resources/config/doctrine/John.orm.php> Generating entity class G:\XAMPP\htdocs\project\src\AppBundle\Entity\John.php: OK!> Generating repository class G:\XAMPP\htdocs\project\src\AppBundle\Repository\JohnRepository.php: OK!> Generating mapping file G:\XAMPP\htdocs\project\src\AppBundle\Resources\config\doctrine\John.orm.php: OK!  Everything is OK! Now get to work :).G:\XAMPP\htdocs\project>

And after success it will will create entity class in AppBundle\Entity; folder and repository class in AppBundle\Repository; also it will generate John.orm.php in AppBundle\Resources\config\doctrine\John.orm.php

After deleting John.orm.php file if i run php bin/console doctrine:schema:update --force then it will generate tables.


Most of the time This error come because of entity path issue and cache. Entity php files must be in your specific folder. Normally we generate entities by command :

 doctrine:generate:entity

run command first

doctrine:cache:clear-metadata

and then try