Orm: Class 'Doctrine\Common\Persistence\Mapping\Driver\AnnotationDriver' not found

Created on 7 Sep 2018  路  4Comments  路  Source: doctrine/orm

Bug Report

| Q | A
|------------ | ------
| BC Break | no
| Version | 2.4.8

Summary

Can't find AnnotationDriver class when running tutorial

Current behavior

Can't find AnnotationDriver class when running tutorial

How to reproduce

Follow all tutorial steps, then run

vendor/bin/doctrine orm:schema-tool:create

This error is returned:

Fatal error: Class 'Doctrine\Common\Persistence\Mapping\Driver\AnnotationDriver' not found in C:\Workspace\xxx\doctrine2-tutorial\vendor\doctrine\orm\lib\Doctrine\ORM\Mapping\Driver\AnnotationDriver.php on line 40

Expected behavior

Schema create will run without error

Bug Documentation

All 4 comments

So I've just got it working by upgrading to doctrine/orm 2.6.

The tutorial says to include this composer.json requiring 2.4 :
"require": { "doctrine/orm": "2.4.*",

Maybe the tutorial should be updated to include whatever version number fixed this

Yes, it should be ^2.6 and YAML reference removed completely.
cc @SenseException

In case of 2.6, YAML ist still in use but needs a deprecation note. This is a fitting change for #7374.

_Getting Started_ needs to be tested with the current and the upcoming versions and the documentation needs an update with the resulting changes of the tests in a new PR.

7412 has been merged which fixes the ORM version in the tutorial.

Was this page helpful?
0 / 5 - 0 ratings