Прогрев кеша Symfony дает исключение аннотации

Я использую инструмент deployer.org с рецептом symfony3 по умолчанию. Задача прогрева кеша в рабочей среде выдает следующую ошибку:

[RuntimeException] [Doctrine\Common\Annotations\AnnotationException] [Семантическая ошибка] Аннотация "@Nelmio\ApiDocBundle\Annotation\ApiDoc" в методе Sonata\ClassificationBundle\Controller\Api\CategoryController::getCategoriesAction() не существует или может не загружаться автоматически.

функция:

поставщик/соната-проект/классификация-пакет/Контроллер/Api/CategoryController.php

используйте Nelmio\ApiDocBundle\Annotation\ApiDoc;

/**
     * Retrieves the list of categories (paginated) based on criteria.
     *
     * @ApiDoc(
     *  resource=true,
     *  output={"class"="Sonata\DatagridBundle\Pager\PagerInterface", "groups"={"sonata_api_read"}}
     * )
     *
     * @return PagerInterface
     */
    public function getCategoriesAction(ParamFetcherInterface $paramFetcher)

мой композитор.json

{
  "name": "symfony/framework-standard-edition",
  "license": "MIT",
  "type": "project",
  "description": "The \"Symfony Standard Edition\" distribution",
  "autoload": {
    "psr-4": {
      "": "src/"
    },
    "classmap": [
      "app/AppKernel.php",
      "app/AppCache.php"
    ]
  },
  "require": {
    "php": "^7.0",
    "symfony/symfony": "3.2.*",
    "doctrine/orm": "^2.5",
    "doctrine/doctrine-bundle": "^1.6",
    "doctrine/doctrine-cache-bundle": "^1.2",
    "symfony/swiftmailer-bundle": "^2.3",
    "symfony/monolog-bundle": "^2.8",
    "sensio/distribution-bundle": "^5.0",
    "sensio/framework-extra-bundle": "^3.0.2",
    "incenteev/composer-parameter-handler": "^2.0",
    "phpspec/prophecy": "^1.3",
    "friendsofsymfony/user-bundle": "~2.0@dev",
    "sonata-project/doctrine-orm-admin-bundle": "^3.0",
    "fresh/doctrine-enum-bundle": "~4.6",
    "hautelook/alice-bundle": "^1.3",
    "knplabs/knp-menu-bundle": "^2.0",
    "beberlei/DoctrineExtensions": "^1.0",
    "sonata-project/media-bundle": "^3.3",
    "ob/highcharts-bundle": "^1.5",
    "twig/extensions": "^1.3",
    "dms/twig-extension-bundle": "^1.2",
    "liip/imagine-bundle": "^1.6",
    "stof/doctrine-extensions-bundle": "^1.2",
    "deployer/deployer": "^4.0"
  },
  "require-dev": {
    "sensio/generator-bundle": "^3.0",
    "symfony/phpunit-bridge": "^3.0",
    "phpunit/phpunit": "4.8.*",
    "doctrine/doctrine-fixtures-bundle": "^2.3",
    "deployer/recipes": "^4.0"
  },
  "scripts": {
    "post-install-cmd": [
      "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
    ],
    "post-update-cmd": [
      "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
    ]
  },
  "config": {
    "bin-dir": "bin"
  },
  "extra": {
    "symfony-app-dir": "app",
    "symfony-bin-dir": "bin",
    "symfony-var-dir": "var",
    "symfony-web-dir": "web",
    "symfony-tests-dir": "tests",
    "symfony-assets-install": "relative",
    "incenteev-parameters": {
      "file": "app/config/parameters.yml"
    }
  }
}

мое ядро ​​приложения:

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),
            new Symfony\Bundle\MonologBundle\MonologBundle(),
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
            new FOS\UserBundle\FOSUserBundle(),
            new Sonata\CoreBundle\SonataCoreBundle(),
            new Sonata\BlockBundle\SonataBlockBundle(),
            new Knp\Bundle\MenuBundle\KnpMenuBundle(),
            new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
            new Sonata\AdminBundle\SonataAdminBundle(),
            new Fresh\DoctrineEnumBundle\FreshDoctrineEnumBundle(),
            new DMS\Bundle\TwigExtensionBundle\DMSTwigExtensionBundle(),
            new Liip\ImagineBundle\LiipImagineBundle(),
            new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),

            new EschBundle\EschBundle()
        );

        if (in_array($this->getEnvironment(), array('dev', 'test'))) {
            $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
            $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();

        }

        return $bundles;
    }



    public function getRootDir()
    {
        return __DIR__;
    }

    public function getCacheDir()
    {
        return $this->getVarOrShmDir('/cache/'.$this->getEnvironment());
    }

    public function getLogDir()
    {
        return $this->getVarOrShmDir('/logs');
    }

    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
    }

    private function getVarOrShmDir($dir)
    {
        $result = dirname(__DIR__) . '/var/' . $dir;

        if (in_array($this->environment, ['dev', 'test'], true) && is_dir('/dev/shm')
        ) {
            $result = '/dev/shm/mijnbuur/' . $dir . '/';
        }

        return $result;
    }

person Joost    schedule 07.12.2016    source источник
comment
можешь выложить код контроллера? в лучшем случае метод и оператор использования   -  person Matteo    schedule 08.12.2016
comment
Добавлена ​​функция и мой AppKernel, чтобы вы могли видеть все пакеты, которые я использую.   -  person Joost    schedule 08.12.2016
comment
попробуйте включить пакет Nelmio, добавив строку new Nelmio\ApiDocBundle\NelmioApiDocBundle() в класс appkernel, если пакет еще не загружен, запустите команду из cli: composer require nelmio/api-doc-bundle   -  person Matteo    schedule 08.12.2016
comment
Все те же ошибки, похоже, это ошибка во внешнем комплекте.   -  person Joost    schedule 08.12.2016


Ответы (1)


была аналогичная проблема. [Доктрина\Общие\Аннотации\АннотацииИсключения]...

Понижение версии композитора с версии 1.3.1 до 1.2.1 решило проблему.

person Tomati    schedule 16.01.2017
comment
вы можете скачать старую версию композитора здесь getcomposer.org/download - person paaacman; 29.01.2017