代码之家  ›  专栏  ›  技术社区  ›  Stefanos

Symfony2:您请求了一个不存在的服务“jms_aop.pointcut_container”。

  •  0
  • Stefanos  · 技术社区  · 11 年前

    我对symfony比较陌生。我已经创建了一个symfony项目,我正在尝试使用JMSDiExtraBundle。问题是,当我运行composer update命令时,会出现以下错误:

        Updating the "app/config/parameters.yml" file
    
    
        [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
        You have requested a non-existent service "jms_aop.pointcut_container".
    
    
    
        Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception
    
    
    
          [RuntimeException]
          An error occurred when executing the ""cache:clear --no-warmup"" command.
    
    
    
        update [--prefer-source] [--prefer-dist] [--dry-run] [--dev]        [--no-dev] [--lock]
         [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader]
         [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [packages1] ... [packagesN]
    
    
    
        C:\pathToProject>[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
        The system cannot find the path specified.
    

    我需要:“jms/di额外捆绑包”:“1.5.0” 但我也尝试过:“jms/di extra bundle”:“1.5.*@dev” 我的symfony版本是:2.6.5

    任何帮助都将不胜感激。

    2 回复  |  直到 7 年前
        1
  •  2
  •   Amadu Bah    8 年前

    在我的案例中,我忘记在app\AppKernel.php中注册捆绑包“JMS\AopBundle\JMSAopBundle”:

    new JMS\AopBundle\JMSAopBundle(),
    
        2
  •  1
  •   Stefanos    7 年前

    我已经解决了我的问题。在运行命令php composer.phar update之前,我在AppKernel.php文件中包含了捆绑包。