title: Symfony - Dependencies not injecting in my entity listener class
body: <p>My autowiring is not working for a basic file entity listener.</p>
  
  <p>I have a File entity class which uses annotations to specify the listener, like:</p>
  
  <pre><code>/**
  
  @Orm\Entity(repositoryClass="root\CoreBundle\Repository\FileRepository")
  @Orm\EntityListeners({"root\CoreBundle\EventListener\Entity\FileEntityListener"})
  @Orm\Table(
  etc...
  </code></pre>
  
  <p>The FileEntityListener class starts off as follows:</p>
  
  <pre><code>class FileEntityListener
  {
  private $encoderFactory;
  private $logger;
  
  public function __construct(FilesystemMap $filesystemMap, LoggerInterface $logger)
  {
      $this-&gt;setFilesystemMap($filesystemMap);
      $this-&gt;logger = $logger;
  }
  </code></pre>
  
  <p>When the listener kicks in, the dependencies aren't injecting into the constructor of the listener and I get an error for the constructor, saying:</p>
  
  <pre><code>Type error: Too few arguments to function Epcvip\CoreBundle\EventListener\Entity\FileEntityListener::__construct(), 0 passed in /var/www/html/accounting/vendor/doctrine/doctrine-bundle/Mapping/ContainerAwareEntityListenerResolver.php on line 83 and exactly 2 expected
  </code></pre>
  
  <p>The bundle is autowired and yet the dependencies are not being injected.</p>
  
  <p>Would anyone know why this isn't working? Maybe a slight configuration step I am missing?</p>