【问题标题】:You have requested a non-existent service "security.acl.dbal.connection"您请求了一个不存在的服务“security.acl.dbal.connection”
【发布时间】:2011-07-30 09:11:26
【问题描述】:

当我在 symfony2.0 中运行 init:acl 我遇到了这个错误,任何人都知道如何解决它!

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

【问题讨论】:

    标签: acl symfony


    【解决方案1】:

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

    acl:
        connection: default
    

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

    【讨论】:

      【解决方案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"       
      

      所以只要确保aclsecurity 关键字之后:

      security:
          acl:
              connection: default
      

      【讨论】:

      • 在 ArrayNode.php 第 331 行:“安全”下的无法识别的选项“acl”。可用选项有“access_control”、“access_decision_manager”、“access_denied_url”、“always_authenticate_before_gran ting”、“encoders”、“erase_credentials”、“firewalls”、“hide_user_not_found”、“providers”、“role_hierarchy”、“session_fixation_strategy”。跨度>
      • @YusufIbrahim 看起来 acl 在 Symfony 4 中不再是内置的。Documentation for acl 说:ACL support was removed in Symfony 4.0. Install the Symfony ACL bundle and refer to its documentation if you want to keep using ACL
      【解决方案3】:

      都不适合我。这个服务其实是不可用的……

      【讨论】:

      • 工作与否,如果您只是使用..."php app/console do:sch:upd --force" 更新架构,FW 将使用 ACL 表更新您的数据库,问题已解决 :)
      猜你喜欢
      • 2013-02-03
      • 2018-03-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-13
      • 2016-12-29
      • 1970-01-01
      相关资源
      最近更新 更多