doctrine-extensions / DoctrineExtensions

Doctrine2 behavioral extensions, Translatable, Sluggable, Tree-NestedSet, Timestampable, Loggable, Sortable
MIT License
4.04k stars 1.27k forks source link

The annotation "@Gedmo\Mapping\Annotation\TranslationEntity" does not exist #260

Closed ghost closed 12 years ago

ghost commented 12 years ago

Hi there, I got the following error:

0 F:\zf2\module\DoctrineORMModule\vendor\doctrine-orm\lib\vendor\doctrine-common\lib\Doctrine\Common\Annotations\DocParser.php(375): Doctrine\Common\Annotations\AnnotationException::semanticalError('The annotation ...')

1 F:\zf2\module\DoctrineORMModule\vendor\doctrine-orm\lib\vendor\doctrine-common\lib\Doctrine\Common\Annotations\DocParser.php(302): Doctrine\Common\Annotations\DocParser->Annotation()

2 F:\zf2\module\DoctrineORMModule\vendor\doctrine-orm\lib\vendor\doctrine-common\lib\Doctrine\Common\Annotations\DocParser.php(182): Doctrine\Common\Annotations\DocParser->Annotations()

3 F:\zf2\module\DoctrineORMModule\vendor\doctrine-orm\lib\vendor\doctrine-common\lib\Doctrine\Common\Annotations\AnnotationReader.php(230): Doctrine\Common\Annotations\DocParser->parse('/*? \ Country?...', 'class Entity\Co...')

4 F:\zf2\module\DoctrineORMModule\vendor\doctrine-orm\lib\vendor\doctrine-common\lib\Doctrine\Common\Annotations\CachedReader.php(80): Doctrine\Common\Annotations\AnnotationReader->getClassAnnotations(Object(ReflectionClass))

5 F:\zf2\module\DoctrineORMModule\vendor\doctrine-orm\lib\Doctrine\ORM\Mapping\Driver\AnnotationDriver.php(128): Doctrine\Common\Annotations\CachedReader->getClassAnnotations(Object(ReflectionClass))

6 F:\ZEND\APPLICATIONS\exotica\zf2\module\DoctrineORMModule\vendor\doctrine-orm\lib\Doctrine\ORM\Mapping\Driver\DriverChain.php(75): Doctrine\ORM\Mapping\Driver\AnnotationDriver->loadMetadataForClass('Entity\Country', Object(Doctrine\ORM\Mapping\ClassMetadata))

7 F:\ZEND\APPLICATIONS\exotica\zf2\module\DoctrineORMModule\vendor\doctrine-orm\lib\Doctrine\ORM\Mapping\ClassMetadataFactory.php(281): Doctrine\ORM\Mapping\Driver\DriverChain->loadMetadataForClass('Entity\Country', Object(Doctrine\ORM\Mapping\ClassMetadata))

8 F:\ZEND\APPLICATIONS\exotica\zf2\module\DoctrineORMModule\vendor\doctrine-orm\lib\Doctrine\ORM\Mapping\ClassMetadataFactory.php(170): Doctrine\ORM\Mapping\ClassMetadataFactory->loadMetadata('Entity\Country')

9 F:\ZEND\APPLICATIONS\exotica\zf2\module\DoctrineORMModule\vendor\doctrine-orm\lib\Doctrine\ORM\EntityManager.php(257): Doctrine\ORM\Mapping\ClassMetadataFactory->getMetadataFor('Entity\Country')

10 F:\ZEND\APPLICATIONS\exotica\zf2\module\DoctrineORMModule\vendor\doctrine-orm\lib\Doctrine\ORM\EntityManager.php(574): Doctrine\ORM\EntityManager->getClassMetadata('Entity\Country')

11 F:\ZEND\APPLICATIONS\exotica\zf2\module\Zone\src\Zone\Model\Service\PaysService.php(10): Doctrine\ORM\EntityManager->getRepository('Entity\Country')

Entity\Country.php:

namespace Entity;

use Gedmo\Mapping\Annotation as Gedmo; use Doctrine\ORM\Mapping as ORM;

/**

Entity\CountryTranslation.php:

namespace Entity;

use Doctrine\ORM\Mapping as ORM; use Gedmo\Translatable\Entity\MappedSuperclass\AbstractPersonalTranslation;

/**

Can you tell me what's wrong ?

l3pp4rd commented 12 years ago

You need to register Gedmo annotation autoloading also:

<?php
Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace(
    'Gedmo\Mapping\Annotation',
    APPLICATION_PATH . '/vendor'
);
ghost commented 12 years ago

Thank you very much Gediminas