Why is this Symfony annotation not working?

Why is this Symfony annotation not working?

Before I start, I should mention that this is&nbsp;<strong>Symfony 2.8.25</strong>. (I just started working on this code base, and once we get some critical issues resolved, we'll be upgrading.)

Before I start, I should mention that this is Symfony 2.8.25. (I just started working on this code base, and once we get some critical issues resolved, we'll be upgrading.)

I have an existing class using annotations with a number of routes that work fine.

I added a new one, and I get a 404 on that one every time. I did a console cache:clear which did not help. When I did a console debug:route, the new Routes appear in the list. But I still get a 404 on them, while the others in the same source file work.

All the routes use a POST, the working and non-working ones.

The routing.yml looks like this:

app:
    resource: '@AppBundle/Controller/'
    type: annotation

logout: path: /logout

The class looks like this:

<?php

namespace AppBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use AppBundle\Entity\Environment; use AppBundle\Entity\Instance; use AppBundle\Entity\Migration; use AppBundle\Entity\UserActivity; use AppBundle\Entity\Task; use AppBundle\Form\Environment\EnvironmentType; use AppBundle\Services\Api; use AppBundle\Utils\HashRequest;

class EnvironmentController extends Controller { ... /** * * @Route("/api/envtype/add", name="api_envtype_add") * */ public function addEnvtypeAction(Request $request){ ...

When I try another route from this same class, it works. But not this new one.

I tried renaming the route, and that made no difference. I checked the annotation comment for TABs, since that's a (semi-)known bug in older versions. No TABs in the annotation.

This annotation looks to me exactly like the others that work. (None of them have a @return, for example.)

PostMan reports No route found for "POST /api/envtype/add"

I am completely out of ideas.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

What is Symfony? Features and applications

**Symfony is a PHP framework** whose work in building and maintaining web applications works very quickly and turns into recurring coding tasks. There are some prerequisites to start it in your computer-Such as - Linux, FreeBSD, Mac OS or...

Symfony 3 application running on OSX

My Symfony 3.4 application is running super slow on DEV environment - it is taking about 35 seconds when using Docker and 20 seconds when running with Symfony's server.