4

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 ?

3
  • There can be several things, wrong namespace, Add the actual code from line 432. Have you used command:$composer install --dev recently? Commented Mar 5, 2016 at 4:53
  • ` 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;` Commented Mar 5, 2016 at 5:14
  • 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;' Commented Mar 5, 2016 at 9:33

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.