# Fehler bei activate:plugin

**URL:** <https://forum.shopware.com/t/fehler-bei-activate-plugin/68791>\
**Category:** Programmierung\
**Created:** [5. August 2020 um 13:28 UTC](https://forum.shopware.com/t/fehler-bei-activate-plugin/68791 "2020-08-05T13:28:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rammi22](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@rammi22](https://forum.shopware.com/u/rammi22)\
**Post date:** [5. August 2020 um 13:28 UTC](https://forum.shopware.com/t/fehler-bei-activate-plugin/68791/1 "2020-08-05T13:28:21Z")

</div>

Halo,

nach Neuinstallation von SW 6.2 via Vagrant Box und _plugin:activate_ erhalte ich folgende Fehlermeldung:  
&nbsp;

```
 The "Shopware\Core\Framework\DataAbstractionLayer\Indexing\EntityIndexerRegistry" service or alias has been removed or inlined when the container was compile  
  d. You should either make it public, or stop using the container directly and use dependency injection instead.  

```

Was ist zu tun um das Teil wieder zum Laufen zu bekommen?

---

<div class="post-metadata">

**Author:** ![Moritz\_Naczenski](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/moritz_naczenski/32/7792_2.png) [@Moritz\_Naczenski](https://forum.shopware.com/u/Moritz_Naczenski)\
**Post date:** [5. August 2020 um 13:37 UTC](https://forum.shopware.com/t/fehler-bei-activate-plugin/68791/2 "2020-08-05T13:37:11Z")

</div>

Was für ein Plugin willst du denn installieren?

---

<div class="post-metadata">

**Author:** ![rammi22](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@rammi22](https://forum.shopware.com/u/rammi22)\
**Post date:** [5. August 2020 um 13:50 UTC](https://forum.shopware.com/t/fehler-bei-activate-plugin/68791/3 "2020-08-05T13:50:24Z")

</div>

[@Moritz Naczenski]([http://forum.shopware.com/profile/14574/Moritz](http://forum.shopware.com/profile/14574/Moritz) Naczenski “Moritz Naczenski”)‍ Ein neu zu entwickeltendes Plugin. Es gab einen Fehler während der Entwicklung, deshalb Neuinstallation von SW 6.2. Die Installation auf dem ‘alten’ System funktionierte einwandfrei. Jetzt nicht mehr. Installiert hatte ich das System das letzte mal vor 2 Tagen, mit der selben Routine, also ohne Anderung an der Vagrant File

---

<div class="post-metadata">

**Author:** ![rammi22](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@rammi22](https://forum.shopware.com/u/rammi22)\
**Post date:** [5. August 2020 um 14:12 UTC](https://forum.shopware.com/t/fehler-bei-activate-plugin/68791/4 "2020-08-05T14:12:29Z")

</div>

Ich versuch es bei [Slack](https://shopwarecommunity.slack.com/archives/C011VFQT7GB/p1596633353457300)

---

<div class="post-metadata">

**Author:** ![Schrank](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/schrank/32/19649_2.png) [@Schrank](https://forum.shopware.com/u/Schrank)\
**Post date:** [24. August 2020 um 11:20 UTC](https://forum.shopware.com/t/fehler-bei-activate-plugin/68791/5 "2020-08-24T11:20:35Z")

</div>

Der Fehler beschreibt, dass der Service nicht public ist. Ich verstehe leider nicht, wo die Quelle des Problems ist, aber lösen kann man es so:

&nbsp;

**Service Aliasen und public machen**

In der services.xml innerhalb des Knoten einen Alias erzeugen:

```
<service id="entity.indexer.registry" alias="Shopware\Core\Framework\DataAbstractionLayer\Indexing\EntityIndexerRegistry" public="true"></service>

```

Anschließend den Alias bei der Aktivierung benutzen:

```
 public function activate(ActivateContext $activateContext): void { $registry = $this-\>container-\>get**('entity.indexer.registry')**; $registry-\>sendIndexingMessage(['product.indexer']); }
```

---

<div class="post-metadata">

**Author:** ![rammi22](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@rammi22](https://forum.shopware.com/u/rammi22)\
**Post date:** [24. August 2020 um 11:53 UTC](https://forum.shopware.com/t/fehler-bei-activate-plugin/68791/6 "2020-08-24T11:53:38Z")

</div>

> [@Schrank schrieb:](https://forum.shopware.com/profile/36280/Schrank "Schrank")
> 
> Der Fehler beschreibt, dass der Service nicht public ist. Ich verstehe leider nicht, wo die Quelle des Problems ist…

&nbsp;Der Fehler liegt (mal wieder) in der [Dokumentation](https://docs.shopware.com/en/shopware-platform-dev-en/how-to/indepth-guide-bundle/entity-association?category=shopware-platform-dev-en/how-to/indepth-guide-bundle#extending-the-productdefinition)und dort an fehlender Info zu enstprechender Version von SW

bis 6.0 -&nbsp; 6.2.3

```
class BundleExample extends Plugin
{
   public function activate(ActivateContext $activateContext): void
   {
       $indexerMessageSender = $this->container->get(IndexerMessageSender::class);
       $indexerMessageSender->partial(new \DateTimeImmutable(), [InheritanceIndexer::getName()]);
   }
}

```

ab 6.3  
&nbsp;

```
class BundleExample extends Plugin
{
    public function activate(ActivateContext $activateContext): void
    {
        $registry = $this->container->get(EntityIndexerRegistry::class);
        $registry->sendIndexingMessage(['product.indexer']);
    }
}

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![Schrank](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/schrank/32/19649_2.png) [@Schrank](https://forum.shopware.com/u/Schrank)\
**Post date:** [24. August 2020 um 12:06 UTC](https://forum.shopware.com/t/fehler-bei-activate-plugin/68791/7 "2020-08-24T12:06:04Z")

</div>

> <https://github.com/shopware/platform/pull/1267>

---

<div class="post-metadata">

**Author:** ![rammi22](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@rammi22](https://forum.shopware.com/u/rammi22)\
**Post date:** [24. August 2020 um 12:54 UTC](https://forum.shopware.com/t/fehler-bei-activate-plugin/68791/8 "2020-08-24T12:54:23Z")

</div>

> [@Schrank schrieb:](https://forum.shopware.com/profile/36280/Schrank "Schrank")
> 
> [https://github.com/shopware/platform/pull/1267](https://github.com/shopware/platform/pull/1267)

…unnötig mit der [richtigen Info](https://github.com/shopware/platform/blob/a586d4ad6d4a79f0b183269450f43ce534fa8dca/src/Core/Framework/DataAbstractionLayer/Indexing/Indexer/InheritanceIndexer.php#L30) ![Wink](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/1X/b3785da0cbf2c8566cb535dcf55b2730b5224899.png "Wink")
