Jayson
Jayson

Reputation: 2193

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

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"

Upvotes: 8

Views: 4837

Answers (3)

Dimitry K
Dimitry K

Reputation: 2356

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

Upvotes: 2

mmoreram
mmoreram

Reputation: 684

Neither worked for me. This service is actually not available...

Upvotes: 0

Problematic
Problematic

Reputation: 17678

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.

Upvotes: 18

Related Questions