[Semantical Error] The annotation does not exist, or could not be auto-loaded.

2810 views
Skip to first unread message

Simone Fumagalli

unread,
Feb 4, 2012, 4:35:00 AM2/4/12
to symfony-...@googlegroups.com
Hello, I'm still exploring the Symfony-CMF world but I'm stuck with this error:

When I run a console command I get 

[Doctrine\Common\Annotations\AnnotationException]
[Semantical Error] The annotation "@Doctrine\ODM\PHPCR\Mapping\Annotations\Document" in class Doctrine\ODM\PHPCR\Document\Generic does not exist, or could not be auto-loaded.

Here my autoload

'Doctrine\\ODM\\PHPCR'      => __DIR__.'/../vendor/phpcr-odm/lib',

'Jackalope' => __DIR__.'/../vendor/phpcr-odm/lib/vendor/jackalope/src',

'PHPCR' => array(
__DIR__.'/../vendor/phpcr-odm/lib/vendor/jackalope/lib/phpcr/src',
__DIR__.'/../vendor/phpcr-odm/lib/vendor/jackalope/lib/phpcr-utils/src'
),

  'PHPCR\\Util' => __DIR__.'/../vendor/phpcr-odm/lib/vendor/jackalope/lib/phpcr-utils/src'

Jackrabbit server is up and running and I run app/console doctrine:phpcr:register-system-node-types

Does someone has hints or some help for it ?

Thanks

--
Simone

David Buchmann

unread,
Feb 4, 2012, 5:21:45 AM2/4/12
to symfony-...@googlegroups.com, Simone Fumagalli
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi simone,

> I'm still exploring the Symfony-CMF world

great, glad to hear from you. i hope we can solve this bug.

are you using the cmf-sandbox? did you change anything from standard?

if not, there is a couple of things i can think that could be wrong.
please try those ideas and if it does not work compare what you have to
what cmf-sandbox does (especially versions of repositories that are
used). i am very glad to fix any issues, but we need to track this down
first ;-)


are you be missing the annotation registry?

AnnotationRegistry::registerLoader(function($class) use ($loader) {
$loader->loadClass($class);
return class_exists($class, false);
});
AnnotationRegistry::registerFile(__DIR__.'/../vendor/symfony-cmf/vendor/doctrine-phpcr-odm/lib/Doctrine/ODM/PHPCR/Mapping/Annotations/DoctrineAnnotations.php');


do you have both the phpcr-odm library and the DoctrinePHPCRBundle in
autoload and configuration for the phpcr bundle? are you using the
doctrine commons that is bundled with the phpcr-odm library or the one
from symfony? there might be version incompatibilities...


cheers,david

- --
Liip AG // Agile Web Development // T +41 26 422 25 11
CH-1700 Fribourg // PGP 0xA581808B // www.liip.ch
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8tBrQACgkQqBnXnqWBgIvkawCff8aDcTPE3DqWl5Z8VYw1G7CO
N10AoIwF5v+IYrb9l4vzbiCvh/XT4hFJ
=0L0N
-----END PGP SIGNATURE-----

David Buchmann

unread,
Feb 4, 2012, 8:34:07 AM2/4/12
to Simone Fumagalli, symfony-...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi simone,

>> are you using the cmf-sandbox? did you change anything from standard?
> No. I'm following this article/guide
> http://melp.nl/2011/07/symfony2-phpcr-doctrine2-jackalope-recipe/

good. note that we are currently building up a new set of tutorials at
https://github.com/symfony-cmf/symfony-cmf-docs

once they are ready, they will go to cmf.symfony.com - until then they
can be read on github. input and contributions are of course welcome :-)

@krizon: i think the annotations are currently missing in
https://github.com/symfony-cmf/symfony-cmf-docs/blob/master/tutorials/installing-configuring-doctrine-phpcr-odm.rst

cheers,david

>> are you be missing the annotation registry?

>> [cut]
>
> I had
>
> AnnotationRegistry::registerFile(__DIR__.'/../vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
>
> I changed with
>
> AnnotationRegistry::registerFile(__DIR__.'/../vendor/phpcr-odm/lib/Doctrine/ODM/PHPCR/Mapping/Annotations/DoctrineAnnotations.php');
>
> And now it works ! :D
>
> Thanks a lot ! Now I'll continue my tests ... Thanks again !

- --
Liip AG // Agile Web Development // T +41 26 422 25 11
CH-1700 Fribourg // PGP 0xA581808B // www.liip.ch
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8tM8sACgkQqBnXnqWBgItsmQCfbbxe6XsH5U5TDOrzm9LLlvj1
IOsAoMXQUo3765kec60SFevm+5FdRpdz
=511U
-----END PGP SIGNATURE-----

Kristian

unread,
Feb 6, 2012, 4:22:32 AM2/6/12
to symfony-cmf-devs
> @krizon: i think the annotations are currently missing inhttps://github.com/symfony-cmf/symfony-cmf-docs/blob/master/tutorials...
The AnnotationRegistry call was in the wrong tutorial. Moved it to the
Doctrine ODM PHPCR part.


On 4 feb, 14:34, David Buchmann <david.buchm...@liip.ch> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> hi simone,
>
> >> are you using the cmf-sandbox? did you change anything from standard?
> > No. I'm following this article/guide
> >http://melp.nl/2011/07/symfony2-phpcr-doctrine2-jackalope-recipe/
>
> good. note that we are currently building up a new set of tutorials athttps://github.com/symfony-cmf/symfony-cmf-docs
>
> once they are ready, they will go to cmf.symfony.com - until then they
> can be read on github. input and contributions are of course welcome :-)
>
> @krizon: i think the annotations are currently missing inhttps://github.com/symfony-cmf/symfony-cmf-docs/blob/master/tutorials...
>
> cheers,david
>
> >> are you be missing the annotation registry?
> >> [cut]
>
> > I had
>
> >    AnnotationRegistry::registerFile(__DIR__.'/../vendor/doctrine/lib/Doctrine/ ORM/Mapping/Driver/DoctrineAnnotations.php');
>
> > I changed with
>
> > AnnotationRegistry::registerFile(__DIR__.'/../vendor/phpcr-odm/lib/Doctrine /ODM/PHPCR/Mapping/Annotations/DoctrineAnnotations.php');
>
> > And now it works ! :D
>
> > Thanks a lot ! Now I'll continue my tests ... Thanks again !
>
> - --
> Liip AG // Agile Web Development // T +41 26 422 25 11
> CH-1700 Fribourg // PGP 0xA581808B //www.liip.ch
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/
Reply all
Reply to author
Forward
0 new messages