2016-12-07 1 views
2

Ich benutze das Tool deployer.org mit dem Standardrezept symfony3. Cache Warm-up Aufgabe auf prod Umgebung gibt den folgenden Fehler:Symfony-Cache-Warmup gibt Annotationsausnahme

[RuntimeException] [Doctrine\Common\Annotations\AnnotationException] [Semantical Error] The annotation "@Nelmio\ApiDocBundle\Annotation\ApiDoc" in method Sonata\ClassificationBundle\Controller\Api\CategoryController::getCategoriesAction() does not exist, or could not be auto-loaded.

die Funktion:

Verkäufer/Sonate-Projekt/Klassifizierung Bündel/Controller/Api/CategoryController.php

Verwendung 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) 

mein composer.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": "[email protected]", 
    "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" 
    } 
    } 
} 

mein AppKernel:

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; 
    } 
+0

können Sie den Code des Controllers eingeben? höchstens die Methode und die Verwendung Anweisung – Matteo

+1

Hinzugefügt die Funktion und meine AppKernel, so dass Sie alle Bundles, die ich benutze, sehen können. – Joost

+0

Versuchen Sie, das Nelmio-Bundle zu aktivieren, indem Sie die Zeile 'new Nelmio \ ApiDocBundle \ NelmioApiDocBundle()' in der Appkernel-Klasse einfügen. Wenn das Bundle noch nicht geladen ist, starten Sie den Befehl cli: 'composer require nelmio/api-doc-bundle' – Matteo

Antwort

0

hatte ein ähnliches Problem. [Doctrine \ Common \ Anmerkungen \ AnnotationException] ...

Downgrade Composer von Version 1.3.1 bis 1.2.1 löste das Problem.

+0

können Sie eine ältere Version von Composer hier herunterladen https://getcomposer.org/download/ – paaacman

Verwandte Themen