title: How split one huge service configuration file into several bundle configuration files
body: <p>I am trying to split one huge monolithic Symfony2 service configuration file into several smaller files and group them by functionality, etc. </p>
  
  <p>My code: </p>
  
  <pre><code>- app/config/config.yml:
  
  imports:
      - { resource: parameters.yml }
      - { resource: "@YYYCarPartsBundle/Resources/config/parameters.yml" }    
      - { resource: "@XXXShopsBundle/Resources/config/parameters.yml" }   
      ...
      - { resource: "@YYYCarPartsBundle/Resources/config/services.yml" }
      - { resource: "@XXXShopsBundle/Resources/config/services.yml" }         
  
  
  - YYYCarPartsBundle/Resources/config/services.yml
  
  services:
      car.parts.provider:
          class: YYY\Services\Parts\Provider\Factory
          arguments:
              - .........
              - .........
  
  
  - XXXShopsBundle/Resources/config/services.yml
  services:
      xxx.webservice.client.find.model:
          class: XXX\Soap\ExtendedSoapClient
          arguments:
              - .........
              - "@car.parts.provider"
  </code></pre>
  
  <p>Unfortunately I am getting this error
  Fatal error: Uncaught exception </p>
  
  <blockquote>
    <p>'Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException'
    with message 'The service "xxx.webservice.client.find.model" has a
    dependency on a non-existent service "car.parts.provider".' in
    vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass.php
    on line 59</p>
  </blockquote>
  
  <p>I thought container will import all resource files in order, but it does not look like. 
  I am using Symfony 2.3.7. I have tried to define xxx.webservice.client.find.model as lazy service, but no effects.</p>
  
  <p>Any help, explanation would be appreciated.</p>