簡體   English   中英

Symfony緩存:使用@Method注釋清除語義錯誤

[英]Symfony cache:clear Semantical Error with @Method Anotation

運行時在我的生產版本上:

php app/console cache:clear --env=prod --no-debug

Symofny拋出AnnotationExeption

[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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM