Symfony Exception

NotFoundHttpException

HTTP 404 Not Found

App\Entity\Categorie object not found by the @ParamConverter annotation.

Exception

Symfony\Component\HttpKernel\Exception\ NotFoundHttpException

  1.         if (null === $object && false === $configuration->isOptional()) {
  2.             $message sprintf('%s object not found by the @%s annotation.'$class$this->getAnnotationName($configuration));
  3.             if ($errorMessage) {
  4.                 $message .= ' '.$errorMessage;
  5.             }
  6.             throw new NotFoundHttpException($message);
  7.         }
  8.         $request->attributes->set($name$object);
  9.         return true;
  1.             return;
  2.         }
  3.         foreach ($this->all() as $converter) {
  4.             if ($converter->supports($configuration)) {
  5.                 if ($converter->apply($request$configuration)) {
  6.                     return;
  7.                 }
  8.             }
  9.         }
  10.     }
  1.         if (\is_object($configurations)) {
  2.             $configurations = [$configurations];
  3.         }
  4.         foreach ($configurations as $configuration) {
  5.             $this->applyConverter($request$configuration);
  6.         }
  7.     }
  8.     /**
  9.      * Applies converter on request based on the given configuration.
  1.             }
  2.             $configurations $this->autoConfigure($r$request$configurations);
  3.         }
  4.         $this->manager->apply($request$configurations);
  5.     }
  6.     private function autoConfigure(\ReflectionFunctionAbstract $rRequest $request$configurations)
  7.     {
  8.         foreach ($r->getParameters() as $param) {
  1.         $this->called true;
  2.         $this->priority $dispatcher->getListenerPriority($eventName$this->listener);
  3.         $e $this->stopwatch->start($this->name'event_listener');
  4.         ($this->optimizedListener ?? $this->listener)($event$eventName$dispatcher);
  5.         if ($e->isStarted()) {
  6.             $e->stop();
  7.         }
  1.         foreach ($listeners as $listener) {
  2.             if ($stoppable && $event->isPropagationStopped()) {
  3.                 break;
  4.             }
  5.             $listener($event$eventName$this);
  6.         }
  7.     }
  8.     /**
  9.      * Sorts the internal list of listeners for the given event by priority.
  1.         } else {
  2.             $listeners $this->getListeners($eventName);
  3.         }
  4.         if ($listeners) {
  5.             $this->callListeners($listeners$eventName$event);
  6.         }
  7.         return $event;
  8.     }
  1.         try {
  2.             $this->beforeDispatch($eventName$event);
  3.             try {
  4.                 $e $this->stopwatch->start($eventName'section');
  5.                 try {
  6.                     $this->dispatcher->dispatch($event$eventName);
  7.                 } finally {
  8.                     if ($e->isStarted()) {
  9.                         $e->stop();
  10.                     }
  11.                 }
  1.         if (false === $controller $this->resolver->getController($request)) {
  2.             throw new NotFoundHttpException(sprintf('Unable to find the controller for path "%s". The route is wrongly configured.'$request->getPathInfo()));
  3.         }
  4.         $event = new ControllerEvent($this$controller$request$type);
  5.         $this->dispatcher->dispatch($eventKernelEvents::CONTROLLER);
  6.         $controller $event->getController();
  7.         // controller arguments
  8.         $arguments $this->argumentResolver->getArguments($request$controller);
  1.     public function handle(Request $requestint $type HttpKernelInterface::MAIN_REQUESTbool $catch true)
  2.     {
  3.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  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.     }
  1.         $this->request $request;
  2.     }
  3.     public function run(): int
  4.     {
  5.         $response $this->kernel->handle($this->request);
  6.         $response->send();
  7.         if ($this->kernel instanceof TerminableInterface) {
  8.             $this->kernel->terminate($this->request$response);
  9.         }
in vendor/autoload_runtime.php -> run (line 35)
  1. $app $app(...$args);
  2. exit(
  3.     $runtime
  4.         ->getRunner($app)
  5.         ->run()
  6. );
require_once('/home/edcle17/public_html/vendor/autoload_runtime.php') in public/index.php (line 5)
  1. <?php
  2. use App\Kernel;
  3. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  4. return function (array $context) {
  5.     return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  6. };

Logs

No log messages

Stack Trace

NotFoundHttpException
Symfony\Component\HttpKernel\Exception\NotFoundHttpException:
App\Entity\Categorie object not found by the @ParamConverter annotation.

  at vendor/sensio/framework-extra-bundle/src/Request/ParamConverter/DoctrineParamConverter.php:107
  at Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter->apply(object(Request), object(ParamConverter))
     (vendor/sensio/framework-extra-bundle/src/Request/ParamConverter/ParamConverterManager.php:84)
  at Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager->applyConverter(object(Request), object(ParamConverter))
     (vendor/sensio/framework-extra-bundle/src/Request/ParamConverter/ParamConverterManager.php:48)
  at Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager->apply(object(Request), array('categorie' => object(ParamConverter), 'livreRepository' => object(ParamConverter), 'categorieRepository' => object(ParamConverter)))
     (vendor/sensio/framework-extra-bundle/src/EventListener/ParamConverterListener.php:72)
  at Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener->onKernelController(object(ControllerEvent), 'kernel.controller', object(TraceableEventDispatcher))
     (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:117)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke(object(ControllerEvent), 'kernel.controller', object(TraceableEventDispatcher))
     (vendor/symfony/event-dispatcher/EventDispatcher.php:230)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.controller', object(ControllerEvent))
     (vendor/symfony/event-dispatcher/EventDispatcher.php:59)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch(object(ControllerEvent), 'kernel.controller')
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch(object(ControllerEvent), 'kernel.controller')
     (vendor/symfony/http-kernel/HttpKernel.php:140)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:74)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:35)
  at require_once('/home/edcle17/public_html/vendor/autoload_runtime.php')
     (public/index.php:5)