2
votes

I have a trouble while creating new entity in my Custom CMS Bundle . At the end of generating through this error :

[InvalidArgumentException]
Doctrine ORM Manager named "" does not exist.

However , I have tried to solve this way . But in this case I got another error :

ClassNotFoundException in DoctrineExtension.php line 432: Attempted to load class "Version" from namespace "Doctrine\ORM". Did you forget a "use" statement for e.g. "Jackalope\Version\Version", "Doctrine\DBAL\Version", "Symfony\Component\Intl\Util\Version", "Doctrine\ODM\PHPCR\Version", "Doctrine\Common\Cache\Version" or "Doctrine\Common\Version"?

What shold I do ? how to fix that ?

1
There can be several things, wrong namespace, Add the actual code from line 432. Have you used command:$composer install --dev recently? - Hassan Naqvi
` if (version_compare(Version::VERSION, "2.3.0-DEV") >= 0) { $methods = array_merge($methods, array( 'setNamingStrategy' => new Reference($entityManager['naming_strategy']), 'setQuoteStrategy' => new Reference($entityManager['quote_strategy']), )); }` this is code from line 432 . unrecognized VERSION . However this code uses ` use Doctrine\ORM\Version;` - kyrgyz_jigit
Its most likely namespace issue. I am guessing you are calling some class that system is looking for in the same folder as current class file. It could also be a very basic thing like you are not declaring namespace or 'use Doctrine\ORM\Mapping as ORM;' - Hassan Naqvi

1 Answers

2
votes

I was facing the same issue and it was a configuration problem.

I added the following lines in /app/config/config.yml file and it solved the issue :

doctrine:
    orm:
        auto_generate_proxy_classes: '%kernel.debug%'
        auto_mapping: true

Used with Symfony 3.4 version.