# Fehlermeldung beim erzeugen einer Entität

**URL:** <https://forum.shopware.com/t/fehlermeldung-beim-erzeugen-einer-entitaet/89294>\
**Category:** Programmierung\
**Created:** [21. Juli 2021 um 10:14 UTC](https://forum.shopware.com/t/fehlermeldung-beim-erzeugen-einer-entitaet/89294 "2021-07-21T10:14:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BMoris](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@BMoris](https://forum.shopware.com/u/BMoris)\
**Post date:** [21. Juli 2021 um 10:14 UTC](https://forum.shopware.com/t/fehlermeldung-beim-erzeugen-einer-entitaet/89294/1 "2021-07-21T10:14:55Z")

</div>

Hallo alle miteinander.

Ich habe eine neue Entität (Definition, Collection, Entity, Migration etc.) nach Anleitung erzeugt. Sobald ich aber den cache:clear ausführe kommt folgende Fehlermeldung. Es steh zwar dort was ihm nicht passt… Aber ich verstehe nicht wie ich das beheben kann da meine Klassennamen Strings sind.

Error {#9013  
#message: „Class name must be a valid object or a string“  
#code: 0  
#file: „/var/www/html/vendor/shopware/core/Framework/DependencyInjection/Compi lerPass/EntityCompilerPass.php“  
#line: 49  
trace: {  
/var/www/html/vendor/shopware/core/Framework/DependencyInjection/CompilerPas s/EntityCompilerPass.php:49 { …}  
/var/www/html/vendor/shopware/core/Framework/DependencyInjection/CompilerPas s/EntityCompilerPass.php:23 { …}  
/var/www/html/vendor/symfony/dependency-injection/Compiler/Compiler.php:91 { …}  
/var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php:736 { …}  
/var/www/html/vendor/symfony/http-kernel/Kernel.php:541 { …}  
/var/www/html/vendor/shopware/core/Kernel.php:175 { …}  
/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:168 { …}  
/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:74 { … }  
/var/www/html/vendor/symfony/console/Application.php:166 { …}  
/var/www/html/bin/console:70 {  
› $application = new Application($kernel-\>getKernel());  
› $application-\>run($input);  
›  
}  
}  
}

Auszug aus meiner Definition.php

class APDefinition extends EntityDefinition  
{  
public const ENTITY\_NAME = ‚angefragtes\_produkt‘;

```
public function getEntityName(): string
{
    return self::ENTITY_NAME;
}

public function getEntityClass(): string
{
    return APEntity::class;
}

public function getCollectionClass(): string
{
    return APCollection::class;
}

```

Wäre cool wenn mich jemand aufklären kann auf was sich diese Fehlermeldung genau bezieht.
