Exceptions

Controller "App%5CController%5CAdmin%5CHcpCrudController" does neither exist as service nor as class.

Exceptions 2

InvalidArgumentException

  1.         if ($e instanceof \ArgumentCountError) {
  2.             throw new \InvalidArgumentException(sprintf('Controller "%s" has required constructor arguments and does not exist in the container. Did you forget to define the controller as a service?'$class), 0$e);
  3.         }
  4.         throw new \InvalidArgumentException(sprintf('Controller "%s" does neither exist as service nor as class.'$class), 0$e);
  5.     }
  6.     private function throwExceptionIfControllerWasRemoved(string $controller, \Throwable $previous)
  7.     {
  8.         if ($this->container instanceof Container && isset($this->container->getRemovedIds()[$controller])) {
  1.     /**
  2.      * {@inheritdoc}
  3.      */
  4.     protected function instantiateController(string $class): object
  5.     {
  6.         $controller parent::instantiateController($class);
  7.         if ($controller instanceof ContainerAwareInterface) {
  8.             $controller->setContainer($this->container);
  9.         }
  10.         if ($controller instanceof AbstractController) {
  1.         }
  2.         if (\is_array($controller)) {
  3.             if (isset($controller[0]) && \is_string($controller[0]) && isset($controller[1])) {
  4.                 try {
  5.                     $controller[0] = $this->instantiateController($controller[0]);
  6.                 } catch (\Error|\LogicException $e) {
  7.                     try {
  8.                         // We cannot just check is_callable but have to use reflection because a non-static method
  9.                         // can still be called statically in PHP but we don't want that. This is deprecated in PHP 7, so we
  10.                         // could simplify this with PHP 8.
  1.      */
  2.     public function getController(Request $request)
  3.     {
  4.         $e $this->stopwatch->start('controller.get_callable');
  5.         $ret $this->resolver->getController($request);
  6.         $e->stop();
  7.         return $ret;
  8.     }
  1.         if (null === $controllerFqcn || null === $controllerAction) {
  2.             return null;
  3.         }
  4.         $newRequest $request->duplicate(nullnull, ['_controller' => [$controllerFqcn$controllerAction]]);
  5.         $controllerCallable $this->controllerResolver->getController($newRequest);
  6.         if (false === $controllerCallable) {
  7.             throw new NotFoundHttpException(sprintf('Unable to find the controller "%s::%s".'$controllerFqcn$controllerAction));
  8.         }
  1.         return $this->getController(DashboardControllerInterface::class, $dashboardControllerFqcn'index'$request);
  2.     }
  3.     private function getCrudController(?string $crudControllerFqcn, ?string $crudActionRequest $request): ?CrudControllerInterface
  4.     {
  5.         return $this->getController(CrudControllerInterface::class, $crudControllerFqcn$crudAction$request);
  6.     }
  7.     private function getController(string $controllerInterface, ?string $controllerFqcn, ?string $controllerActionRequest $request)
  8.     {
  9.         if (null === $controllerFqcn || null === $controllerAction) {
  1.     {
  2.         if (null === $crudControllerFqcn) {
  3.             return null;
  4.         }
  5.         return $this->getCrudController($crudControllerFqcn$crudAction$request);
  6.     }
  7.     private function getDashboardController(?string $dashboardControllerFqcnRequest $request): ?DashboardControllerInterface
  8.     {
  9.         return $this->getController(DashboardControllerInterface::class, $dashboardControllerFqcn'index'$request);
  1.             $crudControllerFqcn $request->query->get(EA::CRUD_CONTROLLER_FQCN);
  2.         }
  3.         $crudAction $request->query->get(EA::CRUD_ACTION);
  4.         return $this->controllerFactory->getCrudControllerInstance($crudControllerFqcn$crudAction$request);
  5.     }
  6.     private function getSymfonyControllerFqcn(Request $request): ?string
  7.     {
  8.         $routeName $request->query->get(EA::ROUTE_NAME);
  1.         }
  2.         // creating the context is expensive, so it's created once and stored in the request
  3.         // if the current request already has an AdminContext object, do nothing
  4.         if (null === $adminContext $request->attributes->get(EA::CONTEXT_REQUEST_ATTRIBUTE)) {
  5.             $crudControllerInstance $this->getCrudControllerInstance($request);
  6.             $adminContext $this->adminContextFactory->create($request$dashboardControllerInstance$crudControllerInstance);
  7.         }
  8.         $request->attributes->set(EA::CONTEXT_REQUEST_ATTRIBUTE$adminContext);
  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.     {
  2.         $this->requestStack->push($request);
  3.         // request
  4.         $event = new RequestEvent($this$request$type);
  5.         $this->dispatcher->dispatch($eventKernelEvents::REQUEST);
  6.         if ($event->hasResponse()) {
  7.             return $this->filterResponse($event->getResponse(), $request$type);
  8.         }
  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/whitetower/solgar/production/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. };

Error

Class 'App%5CController%5CAdmin%5CHcpCrudController' not found

  1.      *
  2.      * @return object
  3.      */
  4.     protected function instantiateController(string $class)
  5.     {
  6.         return new $class();
  7.     }
  8.     private function getControllerError($callable): string
  9.     {
  10.         if (\is_string($callable)) {
  1.         if ($this->container->has($class)) {
  2.             return $this->container->get($class);
  3.         }
  4.         try {
  5.             return parent::instantiateController($class);
  6.         } catch (\Error $e) {
  7.         }
  8.         $this->throwExceptionIfControllerWasRemoved($class$e);
  1.     /**
  2.      * {@inheritdoc}
  3.      */
  4.     protected function instantiateController(string $class): object
  5.     {
  6.         $controller parent::instantiateController($class);
  7.         if ($controller instanceof ContainerAwareInterface) {
  8.             $controller->setContainer($this->container);
  9.         }
  10.         if ($controller instanceof AbstractController) {
  1.         }
  2.         if (\is_array($controller)) {
  3.             if (isset($controller[0]) && \is_string($controller[0]) && isset($controller[1])) {
  4.                 try {
  5.                     $controller[0] = $this->instantiateController($controller[0]);
  6.                 } catch (\Error|\LogicException $e) {
  7.                     try {
  8.                         // We cannot just check is_callable but have to use reflection because a non-static method
  9.                         // can still be called statically in PHP but we don't want that. This is deprecated in PHP 7, so we
  10.                         // could simplify this with PHP 8.
  1.      */
  2.     public function getController(Request $request)
  3.     {
  4.         $e $this->stopwatch->start('controller.get_callable');
  5.         $ret $this->resolver->getController($request);
  6.         $e->stop();
  7.         return $ret;
  8.     }
  1.         if (null === $controllerFqcn || null === $controllerAction) {
  2.             return null;
  3.         }
  4.         $newRequest $request->duplicate(nullnull, ['_controller' => [$controllerFqcn$controllerAction]]);
  5.         $controllerCallable $this->controllerResolver->getController($newRequest);
  6.         if (false === $controllerCallable) {
  7.             throw new NotFoundHttpException(sprintf('Unable to find the controller "%s::%s".'$controllerFqcn$controllerAction));
  8.         }
  1.         return $this->getController(DashboardControllerInterface::class, $dashboardControllerFqcn'index'$request);
  2.     }
  3.     private function getCrudController(?string $crudControllerFqcn, ?string $crudActionRequest $request): ?CrudControllerInterface
  4.     {
  5.         return $this->getController(CrudControllerInterface::class, $crudControllerFqcn$crudAction$request);
  6.     }
  7.     private function getController(string $controllerInterface, ?string $controllerFqcn, ?string $controllerActionRequest $request)
  8.     {
  9.         if (null === $controllerFqcn || null === $controllerAction) {
  1.     {
  2.         if (null === $crudControllerFqcn) {
  3.             return null;
  4.         }
  5.         return $this->getCrudController($crudControllerFqcn$crudAction$request);
  6.     }
  7.     private function getDashboardController(?string $dashboardControllerFqcnRequest $request): ?DashboardControllerInterface
  8.     {
  9.         return $this->getController(DashboardControllerInterface::class, $dashboardControllerFqcn'index'$request);
  1.             $crudControllerFqcn $request->query->get(EA::CRUD_CONTROLLER_FQCN);
  2.         }
  3.         $crudAction $request->query->get(EA::CRUD_ACTION);
  4.         return $this->controllerFactory->getCrudControllerInstance($crudControllerFqcn$crudAction$request);
  5.     }
  6.     private function getSymfonyControllerFqcn(Request $request): ?string
  7.     {
  8.         $routeName $request->query->get(EA::ROUTE_NAME);
  1.         }
  2.         // creating the context is expensive, so it's created once and stored in the request
  3.         // if the current request already has an AdminContext object, do nothing
  4.         if (null === $adminContext $request->attributes->get(EA::CONTEXT_REQUEST_ATTRIBUTE)) {
  5.             $crudControllerInstance $this->getCrudControllerInstance($request);
  6.             $adminContext $this->adminContextFactory->create($request$dashboardControllerInstance$crudControllerInstance);
  7.         }
  8.         $request->attributes->set(EA::CONTEXT_REQUEST_ATTRIBUTE$adminContext);
  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.     {
  2.         $this->requestStack->push($request);
  3.         // request
  4.         $event = new RequestEvent($this$request$type);
  5.         $this->dispatcher->dispatch($eventKernelEvents::REQUEST);
  6.         if ($event->hasResponse()) {
  7.             return $this->filterResponse($event->getResponse(), $request$type);
  8.         }
  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/whitetower/solgar/production/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. };

Stack Traces 2

[2/2] InvalidArgumentException
InvalidArgumentException:
Controller "App%5CController%5CAdmin%5CHcpCrudController" does neither exist as service nor as class.

  at vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php:67
  at Symfony\Component\HttpKernel\Controller\ContainerControllerResolver->instantiateController()
     (vendor/symfony/framework-bundle/Controller/ControllerResolver.php:29)
  at Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver->instantiateController()
     (vendor/symfony/http-kernel/Controller/ControllerResolver.php:49)
  at Symfony\Component\HttpKernel\Controller\ControllerResolver->getController()
     (vendor/symfony/http-kernel/Controller/TraceableControllerResolver.php:38)
  at Symfony\Component\HttpKernel\Controller\TraceableControllerResolver->getController()
     (vendor/easycorp/easyadmin-bundle/src/Factory/ControllerFactory.php:60)
  at EasyCorp\Bundle\EasyAdminBundle\Factory\ControllerFactory->getController()
     (vendor/easycorp/easyadmin-bundle/src/Factory/ControllerFactory.php:50)
  at EasyCorp\Bundle\EasyAdminBundle\Factory\ControllerFactory->getCrudController()
     (vendor/easycorp/easyadmin-bundle/src/Factory/ControllerFactory.php:40)
  at EasyCorp\Bundle\EasyAdminBundle\Factory\ControllerFactory->getCrudControllerInstance()
     (vendor/easycorp/easyadmin-bundle/src/EventListener/AdminRouterSubscriber.php:230)
  at EasyCorp\Bundle\EasyAdminBundle\EventListener\AdminRouterSubscriber->getCrudControllerInstance()
     (vendor/easycorp/easyadmin-bundle/src/EventListener/AdminRouterSubscriber.php:124)
  at EasyCorp\Bundle\EasyAdminBundle\EventListener\AdminRouterSubscriber->onKernelRequest()
     (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:117)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:230)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:59)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
     (vendor/symfony/http-kernel/HttpKernel.php:128)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:74)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (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/whitetower/solgar/production/vendor/autoload_runtime.php')
     (public/index.php:5)                
[1/2] Error
Error:
Class 'App%5CController%5CAdmin%5CHcpCrudController' not found

  at vendor/symfony/http-kernel/Controller/ControllerResolver.php:147
  at Symfony\Component\HttpKernel\Controller\ControllerResolver->instantiateController()
     (vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php:57)
  at Symfony\Component\HttpKernel\Controller\ContainerControllerResolver->instantiateController()
     (vendor/symfony/framework-bundle/Controller/ControllerResolver.php:29)
  at Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver->instantiateController()
     (vendor/symfony/http-kernel/Controller/ControllerResolver.php:49)
  at Symfony\Component\HttpKernel\Controller\ControllerResolver->getController()
     (vendor/symfony/http-kernel/Controller/TraceableControllerResolver.php:38)
  at Symfony\Component\HttpKernel\Controller\TraceableControllerResolver->getController()
     (vendor/easycorp/easyadmin-bundle/src/Factory/ControllerFactory.php:60)
  at EasyCorp\Bundle\EasyAdminBundle\Factory\ControllerFactory->getController()
     (vendor/easycorp/easyadmin-bundle/src/Factory/ControllerFactory.php:50)
  at EasyCorp\Bundle\EasyAdminBundle\Factory\ControllerFactory->getCrudController()
     (vendor/easycorp/easyadmin-bundle/src/Factory/ControllerFactory.php:40)
  at EasyCorp\Bundle\EasyAdminBundle\Factory\ControllerFactory->getCrudControllerInstance()
     (vendor/easycorp/easyadmin-bundle/src/EventListener/AdminRouterSubscriber.php:230)
  at EasyCorp\Bundle\EasyAdminBundle\EventListener\AdminRouterSubscriber->getCrudControllerInstance()
     (vendor/easycorp/easyadmin-bundle/src/EventListener/AdminRouterSubscriber.php:124)
  at EasyCorp\Bundle\EasyAdminBundle\EventListener\AdminRouterSubscriber->onKernelRequest()
     (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:117)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:230)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:59)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
     (vendor/symfony/http-kernel/HttpKernel.php:128)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:74)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (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/whitetower/solgar/production/vendor/autoload_runtime.php')
     (public/index.php:5)