473,397 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Symfony\Component\DependencyInjection\Exception\Pa rameterNotFoundException

103 100+
Could you please help me with "Symfony\Component\DependencyInjection\Exception\P arameterNotFoundException" . You have requested a non-existent parameter "Could not determine the Doctrine manager. Either Doctrine is not configured or a bundle is misconfigured. ".

I am installing and configuring the CMF Core Bundles:
http://symfony.com/doc/current/cmf/cookbook/editions/cmf_core.html

and phpcr_odm bunde:
http://symfony.com/doc/current/cmf/bundles/phpcr_odm/introduction.html

I made all steps in given webpages.

*************************
I was getting ERROR 1 (resolved):
php app/console doctrine:database:create
c:\Bitnami\wampstack-5.4.38-0\sym_prog\Knp>php app/console doctrine:database:create
[Symfony\Component\Config\Definition\Exception\Inva lidConfigurationException]
The child node "default_contexts" at path "sonata_block" must be configured
SOLUTION:
https://sonata-project.org/bundles/block/master/doc/reference/installation.html
added
Expand|Select|Wrap|Line Numbers
  1.  # app/config/config.yml
  2.  
  3. sonata_block:
  4.     default_contexts: [sonata_page_bundle]
  5.     blocks:
  6.         sonata.admin.block.admin_list:
  7.             contexts:   [admin]
  8.  
  9.         #sonata.admin_doctrine_orm.block.audit:
  10.         #    contexts:   [admin]
  11.  
  12.         sonata.block.service.text:
  13.         sonata.block.service.rss:
  14.  
  15.         # Some specific block from the SonataMediaBundle
  16.         #sonata.media.block.media:
  17.         #sonata.media.block.gallery:
  18.         #sonata.media.block.feature_media:
*****
Now i am getting ERROR 2 (could you please HELP):
c:\Bitnami\wampstack-5.4.38-0\sym_prog\Knp>php app/console doctrine:database:create
[Symfony\Component\DependencyInjection\Exception\Pa rameterNotFoundException]
You have requested a non-existent parameter "Could not determine the Doctrine manager. Either Doctrine is not configured or a bundle is misconfigured. ".


C:\Bitnami\wampstack-5.4.38-0\sym_prog\Knp\app\config\config.yml
Expand|Select|Wrap|Line Numbers
  1. imports:
  2.     - { resource: parameters.yml }
  3.     - { resource: security.yml }
  4.     - { resource: services.yml }
  5.  
  6. # Put parameters here that don't need to change on each machine where the app is deployed
  7. # http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
  8. parameters:
  9.     locale: en
  10.  
  11. framework:
  12.     #esi:             ~
  13.     #translator:      { fallbacks: ["%locale%"] }
  14.     secret:          "%secret%"
  15.     router:
  16.         resource: "%kernel.root_dir%/config/routing.yml"
  17.         strict_requirements: ~
  18.     form:            ~
  19.     csrf_protection: ~
  20.     validation:      { enable_annotations: true }
  21.     #serializer:      { enable_annotations: true }
  22.     templating:
  23.         engines: ['twig']
  24.         #assets_version: SomeVersionScheme
  25.     default_locale:  "%locale%"
  26.     trusted_hosts:   ~
  27.     trusted_proxies: ~
  28.     session:
  29.         # handler_id set to null will use default session handler from php.ini
  30.         handler_id:  ~
  31.     fragments:       ~
  32.     http_method_override: true
  33.  
  34. # Twig Configuration
  35. twig:
  36.     debug:            "%kernel.debug%"
  37.     strict_variables: "%kernel.debug%"
  38.  
  39. # Assetic Configuration
  40. assetic:
  41.     debug:          "%kernel.debug%"
  42.     use_controller: false
  43.     bundles:        [ ]
  44.     #java: /usr/bin/java
  45.     filters:
  46.         cssrewrite: ~
  47.         #closure:
  48.         #    jar: "%kernel.root_dir%/Resources/java/compiler.jar"
  49.         #yui_css:
  50.         #    jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"
  51.  
  52. # Doctrine Configuration
  53. doctrine:
  54.     dbal:
  55.         driver:   pdo_mysql
  56.         host:     "%database_host%"
  57.         port:     "%database_port%"
  58.         dbname:   "%database_name%"
  59.         user:     "%database_user%"
  60.         password: "%database_password%"
  61.         charset:  UTF8
  62.         # if using pdo_sqlite as your database driver:
  63.         #   1. add the path in parameters.yml
  64.         #     e.g. database_path: "%kernel.root_dir%/data/data.db3"
  65.         #   2. Uncomment database_path in parameters.yml.dist
  66.         #   3. Uncomment next line:
  67.         #     path:     "%database_path%"
  68.  
  69.     orm:
  70.         auto_generate_proxy_classes: "%kernel.debug%"
  71.         naming_strategy: doctrine.orm.naming_strategy.underscore
  72.         auto_mapping: true
  73.  
  74. # Swiftmailer Configuration
  75. swiftmailer:
  76.     transport: "%mailer_transport%"
  77.     host:      "%mailer_host%"
  78.     username:  "%mailer_user%"
  79.     password:  "%mailer_password%"
  80.     spool:     { type: memory }
  81.  
  82. knp_menu:
  83.     twig: true
  84.  
  85. cmf_core:
  86.     persistence:
  87.         phpcr:
  88.             enabled: true
  89.  
  90. doctrine_phpcr:
  91.     session:
  92.         backend:
  93.             type: doctrinedbal
  94.             # connection: default
  95.  
  96.             # requires DoctrineCacheBundle
  97.             # caches:
  98.             #     meta: doctrine_cache.providers.phpcr_meta
  99.             #     nodes: doctrine_cache.providers.phpcr_nodes
  100.             # enable logging
  101.             logging: true
  102.             # enable profiling in the debug toolbar.
  103.             profiling: true
  104.         workspace: default
  105.         username: admin
  106.         password: admin           
  107.  
  108. # https://sonata-project.org/bundles/block/master/doc/reference/installation.html        
  109. sonata_block:
  110.     default_contexts: [sonata_page_bundle]
  111.     blocks:
  112.         sonata.admin.block.admin_list:
  113.             contexts:   [admin]
  114.  
  115.         #sonata.admin_doctrine_orm.block.audit:
  116.         #    contexts:   [admin]
  117.  
  118.         sonata.block.service.text:
  119.         sonata.block.service.rss:
  120.  
  121.         # Some specific block from the SonataMediaBundle
  122.         #sonata.media.block.media:
  123.         #sonata.media.block.gallery:
  124.         #sonata.media.block.feature_media:

C:\Bitnami\wampstack-5.4.38-0\sym_prog\Knp\app\AppKernel.php
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. use Symfony\Component\HttpKernel\Kernel;
  4. use Symfony\Component\Config\Loader\LoaderInterface;
  5.  
  6. class AppKernel extends Kernel
  7. {
  8.     public function registerBundles()
  9.     {
  10.         $bundles = array(
  11.             new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
  12.             new Symfony\Bundle\SecurityBundle\SecurityBundle(),
  13.             new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
  14.             new Symfony\Bundle\TwigBundle\TwigBundle(),
  15.             new Symfony\Bundle\MonologBundle\MonologBundle(),
  16.             new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
  17.             new Symfony\Bundle\AsseticBundle\AsseticBundle(),
  18.             new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
  19.             new AppBundle\AppBundle(),
  20.             new Knp\IpsumBundle\KnpIpsumBundle(),
  21.             // CMF bundles 
  22.             new Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(),
  23.             new Symfony\Cmf\Bundle\CoreBundle\CmfCoreBundle(),
  24.             new Symfony\Cmf\Bundle\MenuBundle\CmfMenuBundle(),
  25.             new Symfony\Cmf\Bundle\ContentBundle\CmfContentBundle(),
  26.             new Symfony\Cmf\Bundle\BlockBundle\CmfBlockBundle(),
  27.             // Dependencies of the CmfMenuBundle
  28.             new Knp\Bundle\MenuBundle\KnpMenuBundle(),
  29.             // Dependencies of the CmfBlockBundle
  30.             new Sonata\CoreBundle\SonataCoreBundle(),
  31.             new Sonata\BlockBundle\SonataBlockBundle(),    
  32.             // PHPCRBundle
  33.             new Doctrine\Bundle\PHPCRBundle\DoctrinePHPCRBundle(),
  34.             // sefined up new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
  35.         );
  36.  
  37.         if (in_array($this->getEnvironment(), array('dev', 'test'))) {
  38.             $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
  39.             $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
  40.             $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
  41.             $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
  42.         }
  43.  
  44.         return $bundles;
  45.     }
  46.  
  47.     public function registerContainerConfiguration(LoaderInterface $loader)
  48.     {
  49.         $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
  50.     }
  51. }


C:\Bitnami\wampstack-5.4.38-0\sym_prog\Knp\composer.json
Expand|Select|Wrap|Line Numbers
  1. {
  2.     "name": "gintare/knp",
  3.     "license": "proprietary",
  4.     "type": "project",
  5.     "autoload": {
  6.         "psr-4": {
  7.             "": "src/"
  8.         }
  9.     },
  10.     "require": {
  11.         "php": ">=5.3.9",
  12.         "symfony/symfony": "2.7.*",
  13.         "doctrine/orm": "^2.4.8",
  14.         "doctrine/doctrine-bundle": "~1.4",
  15.         "symfony/assetic-bundle": "~2.3",
  16.         "symfony/swiftmailer-bundle": "~2.3",
  17.         "symfony/monolog-bundle": "~2.4",
  18.         "symfony-cmf/symfony-cmf": "1.2.*",
  19.         "sensio/distribution-bundle": "~4.0",
  20.         "sensio/framework-extra-bundle": "^3.0.2",
  21.         "incenteev/composer-parameter-handler": "~2.0",
  22.         "jackalope/jackalope-doctrine-dbal": "1.2.*",
  23.         "doctrine/phpcr-odm": "1.2.*",
  24.         "doctrine/phpcr-bundle": "1.2.*"
  25.     },
  26.     "require-dev": {
  27.         "sensio/generator-bundle": "~2.3"
  28.     },
  29.     "scripts": {
  30.         "post-install-cmd": [
  31.             "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
  32.             "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
  33.             "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
  34.             "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
  35.             "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
  36.             "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
  37.         ],
  38.         "post-update-cmd": [
  39.             "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
  40.             "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
  41.             "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
  42.             "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
  43.             "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
  44.             "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
  45.         ]
  46.     },
  47.     "config": {
  48.         "bin-dir": "bin"
  49.     },
  50.     "extra": {
  51.         "symfony-app-dir": "app",
  52.         "symfony-web-dir": "web",
  53.         "symfony-assets-install": "relative",
  54.         "incenteev-parameters": {
  55.             "file": "app/config/parameters.yml"
  56.         }
  57.     }
  58. }
  59.  
Oct 11 '15 #1
1 2851
gintare
103 100+
I am getting this error with any command, for instance, if i want to list all console commands:

c:\Bitnami\wampstack-5.4.38-0\sym_prog\Knp>php app/console

[Symfony\Component\DependencyInjection\Exception\Pa rameterNotFoundException]
You have requested a non-existent parameter "Could not determine the Doctrine manager. Either Doctrine is not configured or a bundle is misconfigured. ".
Oct 12 '15 #2

Sign in to post your reply or Sign up for a free account.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.