# Error: The service 'xxx' has a dependency on a non-existent service

**URL:** <https://forum.shopware.com/t/error-the-service-xxx-has-a-dependency-on-a-non-existent-service/96804>\
**Category:** Shopware 6 (English)\
**Created:** [22. Oktober 2022 um 22:25 UTC](https://forum.shopware.com/t/error-the-service-xxx-has-a-dependency-on-a-non-existent-service/96804 "2022-10-22T22:25:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefanp](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stefanp](https://forum.shopware.com/u/stefanp)\
**Post date:** [22. Oktober 2022 um 22:25 UTC](https://forum.shopware.com/t/error-the-service-xxx-has-a-dependency-on-a-non-existent-service/96804/1 "2022-10-22T22:25:33Z")

</div>

Hi,

I follow this tutorial [Shopware Online Academy](https://academy.shopware.com/courses/take/shopware-6-developer-training-english/lessons/9225169-controllers) and I have the following error when I relaod the page:

```auto
# The service "SwagShopFinder\Core\Api\DemoDataController" has a dependency on a non-existent service "swag_shop_finder.repository". Did you mean this: "swag_shop_finder .repository"?

```

Any ideea what could be?

later edit:  
the services.xml file content is the following:

```auto
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <services>
        <service id="SwagShopFinder\Core\Content\ShopFinder\ShopFinderDefinition">
            <tag name="shopware.entity.definition" entity="swag_shop_finder" />
        </service>

        <service id="SwagShopFinder\Core\Api\DemoDataController" public="true">
    !! <argument id="country.repository" type="service" />
    !! <argument id="swag_shop_finder.repository" type="service" />
            <call method="setContainer">
                <argument type="service" id="service_container" />
            </call>
        </service>

        <service id="SwagShopFinder\Storefront\Subscriber\FooterSubscriber">
            <argument id="Shopware\Core\System\SystemConfig\SystemConfigService" type="service" />
     !! <argument id="swag_shop_finder.repository" type="service" />
            <tag name="kernel.event_subscriber" />
        </service>
    </services>
</container>

```

Here I have 3 errors: 'Cannot resolve symbol ‚country.repository‘ and ‚swag\_shop\_finde\_repository‘ the lines on the lines that begin with !!

Thanks!

---

<div class="post-metadata">

**Author:** ![abdullah](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@abdullah](https://forum.shopware.com/u/abdullah)\
**Post date:** [23. Oktober 2022 um 22:02 UTC](https://forum.shopware.com/t/error-the-service-xxx-has-a-dependency-on-a-non-existent-service/96804/2 "2022-10-23T22:02:35Z")

</div>

Check the namespace and the autoloader in the composer.json.

I don’t know the online academy, but shopware usually recommends a namespace starting with the manufacturer code, e.g. Swag\ShopFinder\Core\Api\DemoDataController.

---

<div class="post-metadata">

**Author:** ![chamaw](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@chamaw](https://forum.shopware.com/u/chamaw)\
**Post date:** [24. Oktober 2022 um 11:44 UTC](https://forum.shopware.com/t/error-the-service-xxx-has-a-dependency-on-a-non-existent-service/96804/3 "2022-10-24T11:44:10Z")

</div>

This the error message really what is says, so :

> Did you mean this: „swag\_shop\_finder .repository“

So with the space before the dot ???

Then I would assume you have an extra space in the file SwagShopFinderDefinition and check the string for ENTITY\_NAME. Maybe there is an extra space also, which is legal but hard to read.

This line seems to be ok, maybe related to the other error

> country.repository

best

cha
