title: Symfony2 : Unable to find the controller for path "/api/login_check". The route is wrongly configured
body: <p>When I was in dev environnement all goes right and my login work fine but when I put my app in a server and change the environement to prod I get this error </p>
  
  <blockquote>
    <p>Symfony2 : Unable to find the controller for path "/api/login_check". The route is wrongly configured.</p>
  </blockquote>
  
  <p>I know this question is very pupular in the forms but I ve look at all the response and try to resolve this problem but no one work for me.</p>
  
  <p>this is my security.yml</p>
  
  <pre><code>security:
      encoders:
              Project\MyBundle\Entity\User: sha512
  
      role_hierarchy:
              ROLE_USER:     ROLE_USER
              ROLE_ADMIN:    ROLE_ADMIN
      providers:
          in_memory:
              memory: ~
          user:
              entity:
                  class: MyBundle:User
                  property: username
  
      firewalls:
  
          dev:
              pattern: ^/(_(profiler|wdt)|css|images|js)/
              security: false
  
          login:
               pattern:  ^/api/login
               stateless: true
               anonymous: true
               form_login:
                   check_path: /api/login_check
                   provider: user
                   success_handler:         lexik_jwt_authentication.handler.authentication_success
                   failure_handler:          lexik_jwt_authentication.handler.authentication_failure
                   require_previous_session: false
  
          api:
              pattern:   ^/api
              stateless: true
              provider: user
              lexik_jwt: ~
  
          main:
                      anonymous: ~
  
  
      access_control:
          - { path: ^/api/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
          - { path: ^/api,       roles: [ROLE_USER, ROLE_ADMIN] }
  </code></pre>
  
  <p>and this is my routing.yml</p>
  
  <pre><code>app:
      resource: "@AppBundle/Controller/"
      type:     annotation
  
  api_login_check:
      path: /api/login_check
  
  #REST
  rest:
    type : rest
    resource : Project\MyBundle\Controller\MyController
    prefix : /api
  </code></pre>
  
  <p>It's the first time I deploy a symfony project I spent a lot of time with this error hope someone can help me ..thanks in advance</p>