当我运行时在我的生产版本上:
php app/console cache:clear --env=prod --no-debug
Symofny抛出注释Exeption
[Symfony'Component'Config'Exception'FileLoaderLoadException]
Cannot import resource "<path>/App/AppBundle/Controller/DefaultController.php" from "<path>/App/AppBundle/Resources/config/routing.yml". ([Semantical Error] The class "Method" is not annotated with @Annotation. Are you sure this class can be used as annotation? If so, then you need to add @Annotation to the _class_ doc comment of "Method". If it is indeed no annotation, then you need to add @IgnoreAnnotation("Method") to the _class_ doc comment of class @Sensio'Bundle'FrameworkExtraBundle'Configuration'Method.)
[Doctrine'Common'Annotations'AnnotationException]
[Semantical Error] The class "Method" is not annotated with @Annotation. Are you sure this class can be used as annotation? If so, then you need to add @Annotation to the _class_ doc comment of "Method". If it is indeed no annotation, then you need to add @IgnoreAnnotation("Method") to the _class_ doc comment of class @Sensio'Bundle'FrameworkExtraBundle'Configuration'Method.
不知道为什么,在我的本地计算机上它工作正常。其他使用symfony注释的项目工作正常。
软件包版本: http://pastebin.com/71ZNrwSc
它已经用
"sensio/framework-extra-bundle": "dev-master",
与此问题相同Symfony2 ParamConverter与@Annotation无关(任何文件更改后必须清除缓存)
相关问题:https://github.com/symfony/symfony/issues/7283