我正在将网站从Symfony 2.2升级到2.3。
我正在使用奏鸣曲和其他捆绑,2.2版本很好。
我坚持这条消息。
[Symfony的\元器件\ DependencyInjection \异常\ ServiceNotFoundException的]
服务“twig”依赖于不存在的服务“sonata.classification.manager.tag”。
例外:
异常追踪: ()/home/cslucano/Projects/oDesk/tr/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:59 Symfony \ Component \ DependencyInjection \ Compiler \ CheckExceptionOnInvalidReferenceBehaviorPass-> processReferences()/home/cslucano/Projects/oDesk/tr/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:43 Symfony \ Component \ DependencyInjection \ Compiler \ CheckExceptionOnInvalidReferenceBehaviorPass-> processDefinition()/home/cslucano/Projects/oDesk/tr/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:54 Symfony \ Component \ DependencyInjection \ Compiler \ CheckExceptionOnInvalidReferenceBehaviorPass-> processReferences()/home/cslucano/Projects/oDesk/tr/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:52 Symfony \ Component \ DependencyInjection \ Compiler \ CheckExceptionOnInvalidReferenceBehaviorPass-> processReferences()/home/cslucano/Projects/oDesk/tr/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:52 Symfony \ Component \ DependencyInjection \ Compiler \ CheckExceptionOnInvalidReferenceBehaviorPass-> processReferences()/home/cslucano/Projects/oDesk/tr/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:44 Symfony \ Component \ DependencyInjection \ Compiler \ CheckExceptionOnInvalidReferenceBehaviorPass-> processDefinition()/home/cslucano/Projects/oDesk/tr/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:37 /home/cslucano/Projects/oDesk/tr/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php:119中的Symfony \ Component \ DependencyInjection \ Compiler \ CheckExceptionOnInvalidReferenceBehaviorPass-> process() Symfony \ Component \ DependencyInjection \ Compiler \ Compiler-> compile()athome/cslucano/Projects/oDesk/tr/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:629 Symfony \ Component \ DependencyInjection \ ContainerBuilder-> compile()athome/cslucano/Projects/oDesk/tr/app/bootstrap.php.cache:2407 /home/cslucano/Projects/oDesk/tr/app/bootstrap.php.cache:2187中的Symfony \ Component \ HttpKernel \ Kernel-> initializeContainer() Symfony \ Component \ HttpKernel \ Kernel-> boot()/home/cslucano/Projects/oDesk/tr/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:70 Symfony \ Bundle \ FrameworkBundle \ Console \ Application-> doRun()/home/cslucano/Projects/oDesk/tr/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:121 Symfony \ Component \ Console \ Application-> run()at / home / cslucano / Projects / oDesk / tr / app / console:22
答案 0 :(得分:12)
我添加了
new Sonata\ClassificationBundle\SonataClassificationBundle(),
在app/AppKernel.php
中,然后就可以了。