# \[Doctrine\\ORM\\Mapping\\MappingException\] The target-entity ... cannot be found in Shopware\\Models\\..

**URL:** https://forum.shopware.com/t/doctrine-orm-mapping-mappingexception-the-target-entity-cannot-be-found-in-shopware-models/39177
**Category:** Programmierung
**Created:** [18. August 2016 um 15:18 UTC](https://forum.shopware.com/t/doctrine-orm-mapping-mappingexception-the-target-entity-cannot-be-found-in-shopware-models/39177 "2016-08-18T15:18:27Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![mbw](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mbw](https://forum.shopware.com/u/mbw)
#### Post date: [18. August 2016 um 15:18 UTC](https://forum.shopware.com/t/doctrine-orm-mapping-mappingexception-the-target-entity-cannot-be-found-in-shopware-models/39177/1 "2016-08-18T15:18:27Z")

</div>

Hallo !

betrifft Shopware 5.1.6

Der Aufruf von&nbsp;&nbsp; bin/console sw:generate:attributes&nbsp;&nbsp; erzeugt folgende Fehlermeldung:

&nbsp;&nbsp; [Doctrine\ORM\Mapping\MappingException]  
&nbsp;&nbsp; The target-entity Shopware\Models\Attribute\CustomerAddress cannot be found in ‚Shopware\Models\Customer\Address#attribute‘.

Auch lassen sich Plugins nicht updaten, stattdessen folgende Fehlermeldung:

&nbsp;&nbsp;&nbsp; Unable to update, got exception: Order attributes Error. The target-entity Shopware\Models\Attribute\CustomerAddress cannot be found in ‚Shopware\Models\Customer\Address#attribute‘.

/shopware/engine/Shopware/Models/Customer/Address.php ist (von uns jedenfalls) nicht verändert worden.

Wichtig vielleicht noch: vorausgegangen sind zwei Versuche Shopware auf 5.2.4 zu aktualisieren, danach traten aber jeweils Probleme im Zusammenhang mit Adressen auf (Lieferadresse = null, Bestellbestätigungsseite mit „ups“-Fehlermeldung), so dass die Updates wieder rückgängig gemacht werden mussten (webspace und Datenbank restore).

Foreign Keys reparieren wie hier ( [http://community.shopware.com/Foreign-Keys-reparieren\_detail\_954.html?\_ga=1.129023307.631607408.1467969405](http://community.shopware.com/Foreign-Keys-reparieren_detail_954.html?_ga=1.129023307.631607408.1467969405) ) beschrieben hat keine Änderung gebracht.

Wer weiß Rat?

Sind für jeden Hinweis dankbar.

&nbsp;

Schöne Grüße

&nbsp;

&nbsp;

---

<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: [18. August 2016 um 19:06 UTC](https://forum.shopware.com/t/doctrine-orm-mapping-mappingexception-the-target-entity-cannot-be-found-in-shopware-models/39177/2 "2016-08-18T19:06:31Z")

</div>

Hast du den Cache bereits einmal über FTP gelöscht?  
Sieht mir aus als ob deine Attribut-Models im Cache noch alt sind. Die werden nicht über das Backend neu angelegt.

---

<div class="post-metadata">

### Author: ![mbw](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mbw](https://forum.shopware.com/u/mbw)
#### Post date: [19. August 2016 um 08:29 UTC](https://forum.shopware.com/t/doctrine-orm-mapping-mappingexception-the-target-entity-cannot-be-found-in-shopware-models/39177/3 "2016-08-19T08:29:40Z")

</div>

Hallo,

und danke für die Antwort.

/var/cache/clear\_cache.sh führt zu folgenden Fehlermeldungen:

```
 WARNING! The target-entity Shopware\Models\Attribute\CustomerAddress cannot be found in 'Shopware\Models\Customer\Address#attribute'. in /is/htdocs/xyz/shopware/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php

```

und

```
 [Doctrine\ORM\Mapping\MappingException]
  The target-entity Shopware\Models\Attribute\CustomerAddress cannot be found
   in 'Shopware\Models\Customer\Address#attribute'.

```

Dann habe ich per FTP alle Verzeichnisse in /var/cache und alle Dateien in /web/cache gelöscht - ohne Erfolg.

Liegt es vielleicht doch an unserer /shopware/engine/Shopware/Models/Customer/Address.php ?

Address.php und AddressRepository.php haben bei uns einen anderen Zeitstempel als die restlichen Dateien in dem Verzeichnis.

Gibt es “Musterdateien” der Version 5.1.6, die ich mal mit unseren vergleichen könnte?

Vielen Dank im Voraus!

Schöne Grüße

&nbsp;

&nbsp;

&nbsp;

---

<div class="post-metadata">

### Author: ![mbw](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mbw](https://forum.shopware.com/u/mbw)
#### Post date: [19. August 2016 um 09:24 UTC](https://forum.shopware.com/t/doctrine-orm-mapping-mappingexception-the-target-entity-cannot-be-found-in-shopware-models/39177/4 "2016-08-19T09:24:14Z")

</div>

Hallo,

noch ein Versuch:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ./console orm:info&nbsp; gibt diesen Fehler aus (alles andere ist ok):

```
[FAIL] Shopware\Models\Customer\Address
The target-entity Shopware\Models\Attribute\CustomerAddress cannot be found in 'Shopware\Models\Customer\Address#attribute'.

```

Würde es etwas bringen, diese fehlende target-entity mit ./console orm:generate:entities zu erzeugen?&nbsp; Wenn ja, wie lautet der Befehl genau?

Danke im Voraus!

mfG

&nbsp;

---

<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: [19. August 2016 um 09:35 UTC](https://forum.shopware.com/t/doctrine-orm-mapping-mappingexception-the-target-entity-cannot-be-found-in-shopware-models/39177/5 "2016-08-19T09:35:52Z")

</div>

Hast du ggf. ein fehlgeschlagenes Update durchgeführt?  
In der 5.1.6 gibt es die Datei noch garnicht…

Siehe 5.1.6:&nbsp;[shopware/engine/Shopware/Models/Customer at 5.1 · shopware/shopware · GitHub](https://github.com/shopware/shopware/tree/5.1/engine/Shopware/Models/Customer)

Vielleicht wurde die beim Backuip nicht gelöscht?

---

<div class="post-metadata">

### Author: ![mbw](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mbw](https://forum.shopware.com/u/mbw)
#### Post date: [19. August 2016 um 11:03 UTC](https://forum.shopware.com/t/doctrine-orm-mapping-mappingexception-the-target-entity-cannot-be-found-in-shopware-models/39177/6 "2016-08-19T11:03:52Z")

</div>

das war’s ! 🙂

Address.php und AddressRepository.php in /shopware/engine/Shopware/Models/Customer/&nbsp; gelöscht, Problem gelöst.

Vielen Dank.

---

<div class="post-metadata">

### Author: ![MGM](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@MGM](https://forum.shopware.com/u/MGM)
#### Post date: [20. Februar 2017 um 11:50 UTC](https://forum.shopware.com/t/doctrine-orm-mapping-mappingexception-the-target-entity-cannot-be-found-in-shopware-models/39177/7 "2017-02-20T11:50:03Z")

</div>

Guten Tag,

ich habe die gleiche Fehlermeldung in 5.2.18. Leider hilft die Löschung der Files bei mir nicht.

Gibt es bei 5.2.18 eine andere Lösung?

Besten Gruß

&nbsp;
