Annotation reader not working #3

redotheoffice opened this Issue Oct 17, 2011 · 2 comments


None yet

3 participants



I tried getting the DoctrineCouchDBBundle to work today, but without success. The following error is what I get:

[Semantical Error] The annotation "@Document" in class Acme\DemoBundle\Document\Article was never imported. Did you maybe forget to add a "use" statement for this annotation?

It seems an annotiotion reader should be loaded, but I don't know how. I'm using the latest build of Symfony

This is the Article.php which I try to implement:

topic = $value; } public function getTopic() { return $this->topic; } public function setText($value='') { $this->text=$value; } public function getText() { return $this->text; } public function setId($value='') { $this->id = $value; } public function getId() { return $this->id; } } Should something special be run in autoload.php for the AnnotationRegistry::registerFile?? Thanks
stof commented Oct 17, 2011

The use statements are missing for the annotation classes



I understand the use statements are missing, but there is no documentation on what the use statements should be.

From the mongodb documentation I got that it should be:
namespace Acme\DemoBundle\Document;
use Doctrine\ODM\CouchDB\Mapping\Annotations as CouchDB;


  • @CouchDB\Document
    class Ticket
    * @CouchDB\Id */
    private $id;


    • @CouchDB\Field(type="string")
      private $topic;


    • @CouchDB\Field(type="string")
      private $text;

    // a bunch of setters and getters

I think there should be an update to the documentation which has a full working example. The code snippets now are too little for someone starting with CouchDB ODM.

Kind regards

@beberlei beberlei closed this Dec 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment