title: You have requested a non-existent service "user_service"
body: <p>Iam trying to implement service for encoding password but it seems it doesn't work cause I get "You have requested a non-existent service user_service "  error.</p>
  
  <p>Here is my code :</p>
  
  <h1>Vendor/BundleNameBundle/Resources/config/services.yml</h1>
  
  <pre><code>services:
      user_service:
           class:  Morescreens\VideomanagerBundle\Service\UserService
           arguments: ['@security.encoder_factory']
  </code></pre>
  
  <h1>app/config/config.yml</h1>
  
  <pre><code>imports:
      - { resource: "@morescreensVideomanagerBundle/Resources/config/services.yml" }
  </code></pre>
  
  <h1>code for my service</h1>
  
  <pre><code>class UserService {
  
      /**
       * @var EncoderFactoryInterface
       */
      private $encoderFactory;
  
  
  
      public function  __construct(EncoderFactoryInterface $encoderFactory)
      {
             $this-&gt;encoderFactory=$encoderFactory;
      }
  
  
      public  function  setEncodedPassword(User $user)
     {
           $encoder=$this-&gt;encoderFactory-&gt;getEncoder($user);
           $password=$encoder-&gt;encodePassword($user-&gt;getPassword(),$user-&gt;getSalt());
           $user-&gt;setPassword($password);
     }
  
  }
  </code></pre>
  
  <h1>Inside mine controller:</h1>
  
  <pre><code> $user=new User();
          $user-&gt;setPassword('password');
  
          $this-&gt;get('user_service')-&gt;setEncodedPassword($user);
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>I manually deleted cache folder and my service started to work.</p>