Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

symfony

acl

when I run init:acl in symfony2.0 I got this error, anyone knows how to fix it!

You have requested a non-existent service "security.acl.dbal.connection"
like image 974
Jayson Avatar asked Jul 30 '11 09:07

Jayson


2 Answers

You need to enable ACL support in your application. Add this line to your security.yml configuration file:

acl:
    connection: default

Then run php app/console init:acl again.

like image 123
Derek Stobbe Avatar answered Oct 18 '22 20:10

Derek Stobbe


Just to give heads up that, acl keywords should be placed on lines following the security keyword. If you ONLY put

acl:
  connection: default 

In the top of your security.yml file, you may get this error. I am quoting it so that people can come to this thread by googling the error.

  [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"       

So just make sure acl is after security keyword:

security:
    acl:
        connection: default
like image 20
Dimitry K Avatar answered Oct 18 '22 20:10

Dimitry K