Symfony Exception

MappingException

HTTP 500 Internal Server Error

Class 'App\Entity\product' does not exist

Exception

Doctrine\Persistence\Mapping\ MappingException

  1.      *
  2.      * @return self
  3.      */
  4.     public static function nonExistingClass($className)
  5.     {
  6.         return new self(sprintf("Class '%s' does not exist"$className));
  7.     }
  8. }
  9. class_exists(\Doctrine\Common\Persistence\Mapping\MappingException::class);
  1.      * {@inheritDoc}
  2.      */
  3.     public function getParentClasses($class)
  4.     {
  5.         if (! class_exists($class)) {
  6.             throw MappingException::nonExistingClass($class);
  7.         }
  8.         return class_parents($class);
  9.     }
  1.     protected function getParentClasses($name)
  2.     {
  3.         // Collect parent classes, ignoring transient (not-mapped) classes.
  4.         $parentClasses = [];
  5.         foreach (array_reverse($this->getReflectionService()->getParentClasses($name)) as $parentClass) {
  6.             if ($this->getDriver()->isTransient($parentClass)) {
  7.                 continue;
  8.             }
  9.             $parentClasses[] = $parentClass;
  1.             $this->initialize();
  2.         }
  3.         $loaded = [];
  4.         $parentClasses   $this->getParentClasses($name);
  5.         $parentClasses[] = $name;
  6.         // Move down the hierarchy of parent classes, starting from the topmost class
  7.         $parent          null;
  8.         $rootEntityFound false;
  1.     /**
  2.      * {@inheritDoc}
  3.      */
  4.     protected function loadMetadata($name)
  5.     {
  6.         $loaded parent::loadMetadata($name);
  7.         array_map([$this'resolveDiscriminatorValue'], array_map([$this'getMetadataFor'], $loaded));
  8.         return $loaded;
  9.     }
  1.                 if ($cached instanceof ClassMetadata) {
  2.                     $this->loadedMetadata[$realClassName] = $cached;
  3.                     $this->wakeupReflection($cached$this->getReflectionService());
  4.                 } else {
  5.                     foreach ($this->loadMetadata($realClassName) as $loadedClassName) {
  6.                         $this->cacheDriver->save(
  7.                             $loadedClassName $this->cacheSalt,
  8.                             $this->loadedMetadata[$loadedClassName]
  9.                         );
  10.                     }
  1.      *
  2.      * @return \Doctrine\ORM\Mapping\ClassMetadata
  3.      */
  4.     public function getClassMetadata($className)
  5.     {
  6.         return $this->metadataFactory->getMetadataFor($className);
  7.     }
  8.     /**
  9.      * {@inheritDoc}
  10.      */
in vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php->getClassMetadata (line 2708)
  1.             // Check if the association is not among the fetch-joined associations already.
  2.             if (isset($hints['fetchAlias']) && isset($hints['fetched'][$hints['fetchAlias']][$field])) {
  3.                 continue;
  4.             }
  5.             $targetClass $this->em->getClassMetadata($assoc['targetEntity']);
  6.             switch (true) {
  7.                 case ($assoc['type'] & ClassMetadata::TO_ONE):
  8.                     if ( ! $assoc['isOwningSide']) {
  1.         if (isset($this->_hints[Query::HINT_REFRESH_ENTITY])) {
  2.             $this->registerManaged($this->class$this->_hints[Query::HINT_REFRESH_ENTITY], $data);
  3.         }
  4.         $uow    $this->_em->getUnitOfWork();
  5.         $entity $uow->createEntity($entityName$data$this->_hints);
  6.         $result[] = $entity;
  7.         if (isset($this->_hints[Query::HINT_INTERNAL_ITERATION]) && $this->_hints[Query::HINT_INTERNAL_ITERATION]) {
  8.             $this->_uow->hydrationComplete();
  1.     protected function hydrateAllData()
  2.     {
  3.         $result = [];
  4.         while ($row $this->_stmt->fetch(PDO::FETCH_ASSOC)) {
  5.             $this->hydrateRowData($row$result);
  6.         }
  7.         $this->_em->getUnitOfWork()->triggerEagerLoads();
  8.         return $result;
  1.         $this->_em->getEventManager()->addEventListener([Events::onClear], $this);
  2.         $this->prepare();
  3.         $result $this->hydrateAllData();
  4.         $this->cleanup();
  5.         return $result;
  6.     }
  1.         [$params$types] = $this->expandParameters($criteria);
  2.         $stmt $this->conn->executeQuery($sql$params$types);
  3.         $hydrator $this->em->newHydrator(($this->currentPersisterContext->selectJoinSql) ? Query::HYDRATE_OBJECT Query::HYDRATE_SIMPLEOBJECT);
  4.         return $hydrator->hydrateAll($stmt$this->currentPersisterContext->rsm, [UnitOfWork::HINT_DEFEREAGERLOAD => true]
  5.         );
  6.     }
  7.     /**
  8.      * {@inheritdoc}
  1.      */
  2.     public function findBy(array $criteria, array $orderBy null$limit null$offset null)
  3.     {
  4.         $persister $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName);
  5.         return $persister->loadAll($criteria$orderBy$limit$offset);
  6.     }
  7.     /**
  8.      * Finds a single entity by a set of criteria.
  9.      *
  1.      *
  2.      * @return array The entities.
  3.      */
  4.     public function findAll()
  5.     {
  6.         return $this->findBy([]);
  7.     }
  8.     /**
  9.      * Finds entities by a set of criteria.
  10.      *
EntityRepository->findAll() in src/Controller/CorporativeController.php (line 38)
  1.      * @Template("Omelo/Corporative/view.html.twig")
  2.      */
  3.     public function corporative(EntityManagerInterface $emUserService $userServ)
  4.     {
  5.         $twigData = array();
  6.         $twigData['corpoItems'] = $em->getRepository(Corporative::class)->findAll();
  7.         return $twigData;
  8.     }
  9. }
in vendor/symfony/http-kernel/HttpKernel.php->corporative (line 169)
  1.         $this->dispatcher->dispatch($eventKernelEvents::CONTROLLER_ARGUMENTS);
  2.         $controller $event->getController();
  3.         $arguments $event->getArguments();
  4.         // call controller
  5.         $response $controller(...$arguments);
  6.         // view
  7.         if (!$response instanceof Response) {
  8.             $event = new ViewEvent($this$request$type$response);
  9.             $this->dispatcher->dispatch($eventKernelEvents::VIEW);
  1.     {
  2.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  3.         $this->requestStack->push($request);
  4.         try {
  5.             return $this->handleRaw($request$type);
  6.         } catch (\Exception $e) {
  7.             if ($e instanceof RequestExceptionInterface) {
  8.                 $e = new BadRequestHttpException($e->getMessage(), $e);
  9.             }
  10.             if (false === $catch) {
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
Kernel->handle() in public/index.php (line 35)
  1.     Request::setTrustedHosts(explode(','$trustedHosts));
  2. }
  3. $kernel = new Kernel($env$debug);
  4. $request Request::createFromGlobals();
  5. $response $kernel->handle($request);
  6. $response->send();
  7. $kernel->terminate($request$response);

Logs

No log messages

Stack Trace

MappingException

Doctrine\Persistence\Mapping\MappingException:
Class 'App\Entity\product' does not exist

  at vendor/doctrine/persistence/lib/Doctrine/Persistence/Mapping/MappingException.php:94
  at Doctrine\Persistence\Mapping\MappingException::nonExistingClass()
     (vendor/doctrine/persistence/lib/Doctrine/Persistence/Mapping/RuntimeReflectionService.php:36)
  at Doctrine\Persistence\Mapping\RuntimeReflectionService->getParentClasses()
     (vendor/doctrine/persistence/lib/Doctrine/Persistence/Mapping/AbstractClassMetadataFactory.php:252)
  at Doctrine\Persistence\Mapping\AbstractClassMetadataFactory->getParentClasses()
     (vendor/doctrine/persistence/lib/Doctrine/Persistence/Mapping/AbstractClassMetadataFactory.php:285)
  at Doctrine\Persistence\Mapping\AbstractClassMetadataFactory->loadMetadata()
     (vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:82)
  at Doctrine\ORM\Mapping\ClassMetadataFactory->loadMetadata()
     (vendor/doctrine/persistence/lib/Doctrine/Persistence/Mapping/AbstractClassMetadataFactory.php:185)
  at Doctrine\Persistence\Mapping\AbstractClassMetadataFactory->getMetadataFor()
     (vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:288)
  at Doctrine\ORM\EntityManager->getClassMetadata()
     (vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:2708)
  at Doctrine\ORM\UnitOfWork->createEntity()
     (vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php:155)
  at Doctrine\ORM\Internal\Hydration\SimpleObjectHydrator->hydrateRowData()
     (vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php:70)
  at Doctrine\ORM\Internal\Hydration\SimpleObjectHydrator->hydrateAllData()
     (vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php:153)
  at Doctrine\ORM\Internal\Hydration\AbstractHydrator->hydrateAll()
     (vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php:901)
  at Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll()
     (vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php:178)
  at Doctrine\ORM\EntityRepository->findBy()
     (vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php:161)
  at Doctrine\ORM\EntityRepository->findAll()
     (src/Controller/CorporativeController.php:38)
  at App\Controller\CorporativeController->corporative()
     (vendor/symfony/http-kernel/HttpKernel.php:169)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:81)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:201)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (public/index.php:35)