# Plugin Entwicklung: "StorePluginController" has no container set

**URL:** <https://forum.shopware.com/t/plugin-entwicklung-storeplugincontroller-has-no-container-set/90049>\
**Category:** Programmierung\
**Tags:** general, programming\
**Created:** [31. August 2021 um 12:31 UTC](https://forum.shopware.com/t/plugin-entwicklung-storeplugincontroller-has-no-container-set/90049 "2021-08-31T12:31:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hashtag\_Assist](https://avatars.discourse-cdn.com/v4/letter/h/e19b73/32.png) [@Hashtag\_Assist](https://forum.shopware.com/u/Hashtag_Assist)\
**Post date:** [31. August 2021 um 12:31 UTC](https://forum.shopware.com/t/plugin-entwicklung-storeplugincontroller-has-no-container-set/90049/1 "2021-08-31T12:31:20Z")

</div>

Ich versuche einen view in meinem Plugin über die URL [ww.shopwarestore.de/meineRoute](http://ww.shopwarestore.de/meineRoute)  
aufzurufen.  
Leider bekam ich immer die gleiche Fehlermeldung.

# „Mein\Plugin\Controller\MeinPluginController“ has no container set, did you forget to define it as a service subscriber?

Nach langem Gesuche habe ich testweise das „swag-store-plugin-example“ ([GitHub - shopwareLabs/swag-store-plugin-example: Example code for the blog entry "The new pluginsystem - how to extend Shopware 6 with Plugins"](https://github.com/shopwareLabs/swag-store-plugin-example)) installiert um im Verglich der Config Dateien mein Problem zu finden…

Jetzt versuche ich die Route „/store-plugins“ aufzurufen und bekomme den gleichen Fehler wie bei meinem Selbstgeschriebenen. Daher denke ich, dass Problem liegt irgendwo bei den Core-Files

Hat jemand Erfahrung mit der Fehlermeldung? Liegt es an meinem und an dem SW Plugin oder ist meine Installation kaputt?

composer.json

```auto
{

    "name": "jiv/lernwelt",

    "description": "Lernwelt",

    "version": "v1.0.1",

    "license": "MIT",

    "authors": [

        {

            "name": "Jura Intensiv Verlag"

        }

    ],

    "require": {

        "shopware/core": "*",

        "shopware/storefront": "*"

    },

    "type": "shopware-platform-plugin",

    "autoload": {

        "psr-4": {

            "Jiv\\Lernwelt\\": "src/"

        }

    },

    "extra": {

        "shopware-plugin-class": "Jiv\\Lernwelt\\Lernwelt",

        "copyright": "(C) Philipp Rien",

        "label": {

            "de-DE": "Lernwelt",

            "en-GB": "Lernwelt"

        }

    }

}

```

routes.xml

```auto
<?xml version="1.0" encoding="UTF-8"?>

    <routes xmlns="http://symfony.com/schema/routing" 

            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 

            xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">

        <import resource="../../Storefront/Controller/**/*Controller.php" type="annotation" />

    </routes>

```

service.xml

```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="Jiv\Lernwelt\Storefront\Controller\LernweltController" public="true">

            <call method="setContainer">

                <argument type="service" id="service_container"/>

            </call>

        </service>

    </services>

</container>

```

LernweltController.php

```auto
<?php declare(strict_types=1);

namespace Jiv\Lernwelt\Storefront\Controller;

use Shopware\Core\Framework\Context;

use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;

use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;

use Shopware\Core\Framework\DataAbstractionLayer\Search\Sorting\FieldSorting;

use Shopware\Core\Framework\Routing\Annotation\RouteScope;

use Shopware\Storefront\Controller\StorefrontController;

use Swag\StorePlugin\Entity\StorePluginEntity;

use Symfony\Component\HttpFoundation\Response;

use Symfony\Component\Routing\Annotation\Route;

/**

 * @RouteScope(scopes={"storefront"})

 */

class LernweltController extends StorefrontController

{

    /**

    * @Route("/jiv", name="frontend.jiv.lernwelt", methods={"GET"})

    */

    public function showExample(): Response

    {

        return $this->renderStorefront('@SwagBasicExample/storefront/page/example/index.html.twig', [

            'example' => 'Hello world'

        ]);

    }

}

```

Beste Grüße

---

<div class="post-metadata">

**Author:** ![Eddin](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/eddin/32/16725_2.png) [@Eddin](https://forum.shopware.com/u/Eddin)\
**Post date:** [1. Januar 2023 um 14:34 UTC](https://forum.shopware.com/t/plugin-entwicklung-storeplugincontroller-has-no-container-set/90049/2 "2023-01-01T14:34:49Z")

</div>

you need to add in the Services.xml your Controller, so in your case:

```auto
 <service id="Jiv\Lernwelt\Controller\LernweltController" public="true">
            <call method="setContainer">
                <argument type="service" id="service_container"/>
            </call>
        </service>

```

check if the path right here „Jiv\Lernwelt\Controller\LernweltController“
