您已请求不存在的服务“security.acl.dbal.connection”

时间:2011-07-30 09:11:26

标签: acl symfony

当我在symfony2.0中运行init:acl时 我收到此错误,有人知道如何修复它!

You have requested a non-existent service "security.acl.dbal.connection"

3 个答案:

答案 0 :(得分:18)

您需要在应用程序中启用ACL支持。将此行添加到security.yml配置文件中:

acl:
    connection: default

然后再次运行php app/console init:acl

答案 1 :(得分:2)

只是提醒一下,acl关键字应放在security关键字后面的行上。如果你只是把

acl:
  connection: default 

security.yml文件的顶部,您可能会收到此错误消息。我引用它以便人们可以通过谷歌搜索错误来到这个线程。

  [Symfony\Component\Config\Exception\FileLoaderLoadException]         
  Cannot import resource "/home/jupiter/symfony/cupon/app/config/secu  
  rity.yml" from "/home/jupiter/symfony/cupon/app/config/config.yml".  
  (There is no extension able to load the configuration for "acl" 
  (in /home/jupiter/symfony/cupon/app/config/security.yml). Looked for   
  namespace "acl", found "framework", "security", "twig", "monolog",   
  "swiftmailer", "assetic", "doctrine", "sensio_framework_extra", "ci  
  udad", "usuario", "tienda", "oferta", "backend", "ideup_simple_pagi  
  nator", "web_profiler", "sensio_distribution")    


  [Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]  
  There is no extension able to load the configuration for "acl" (in          
  /home/jupiter/symfony/cupon/app/config/security.yml). Looked for na         
  mespace "acl", found "framework", "security", "twig", "monolog", "s         
  wiftmailer", "assetic", "doctrine", "sensio_framework_extra", "ciud         
  ad", "usuario", "tienda", "oferta", "backend", "ideup_simple_pagina         
  tor", "web_profiler", "sensio_distribution"       

因此,请确保acl关键字位于security之后:

security:
    acl:
        connection: default

答案 2 :(得分:0)

两者都不适合我。这项服务实际上不可用......