2

i'm upgrading symfony's version from 2.8 to 3.0.9, and after fixing the errors with some library's versions and other problems, i have tried run the command "php bin/console cache:clear" with problems:

C:\inetpub\wwwroot\360forfuture>php bin/console cache:clear

 // Clearing the cache for the dev environment with debug true



  [Symfony\Component\Config\Exception\FileLoaderLoadException]
  [Semantical Error] The annotation "@Sensio\Bundle\FrameworkExtraBundle\Configuration\Route" in method H360\ParkingBundle\Controller\DisponibilidadController::indexAction() does not exist, or could not be auto-loaded in C:\inetpub\wwwroot\360forfuture\src\H360\
  ParkingBundle/Controller/DisponibilidadController.php (which is being imported from "C:\inetpub\wwwroot\360forfuture\src\H360\ParkingBundle/Resources/config/routing.yml").



  [Doctrine\Common\Annotations\AnnotationException]
  [Semantical Error] The annotation "@Sensio\Bundle\FrameworkExtraBundle\Configuration\Route" in method H360\ParkingBundle\Controller\DisponibilidadController::indexAction() does not exist, or could not be auto-loaded.


cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>

This is part of my file "DisponibilidadController.php":

namespace H360\ParkingBundle\Controller;

use H360\generalBundle\Tools\Controller360 as Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\JsonResponse;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use H360\ParkingBundle\Entity\ParParkingPlazas;
use H360\ParkingBundle\Entity\ParParkingReservas;
use H360\ParkingBundle\Form\GenDisponibilidadParkingType;
use H360\ParkingBundle\Form\GenCrearReservaParkingType;

/**
 * 
 */
class DisponibilidadController extends Controller {

    /**
     * @Route("/index", name="disponibilidad_parking_index")
     *   
     * 
     */
    public function indexAction() {

        // Formulario de búsqueda
        $options = array();
        $options['establecimiento'] = $this->IdEstabActual();
        ...

This is part of my file "routing.yml":

parking_disponibilidad:
    resource: "@ParkingBundle/Controller/DisponibilidadController.php"
    prefix:   /disponibilidad
    type:     annotation

So, another thing to keep in mind, is that with the new Symfony's version i have had that enable "sensio_framework_extra" in config.yml... Maybe there is a conflict between RestBundle and this... or the sintax is different now. Any idea?

  • Classic example of: I told you so. – Cerad Mar 09 '21 at 17:48
  • You might need to delete the cache directory then allow Symfony to regenerate the cache. I have seen clearing the cache not always work. I got this tip a while ago from the Symfony slack channel. – Robert Saylor Mar 09 '21 at 20:11
  • @RobertSaylor thanks, but i have already tried delete the cache and exist the same problem... In the project, there are many places where in the YML file is the type "annotation" with the resource "pointing" a one file PHP. – Erik Viera Olivares Mar 10 '21 at 14:39
  • 1
    Finally, i solved the problem. The file "autoload.php" was wrong. Thanks ! @RobertSaylor – Erik Viera Olivares Apr 14 '21 at 15:59

1 Answers1

1

Finally, i solved the problem. The file "autoload.php" was wrong.