Symfony 4.1: Sie haben einen nicht existierenden Dienst "Doctrine" angefordertPhp

PHP-Programmierer chatten hier
Anonymous
 Symfony 4.1: Sie haben einen nicht existierenden Dienst "Doctrine" angefordert

Post by Anonymous »

Hallo, ich mache ein neues Projekt auf Symfony 4.1, < /p>

Ich benutze Postgres 10.5 als mein sgbd. Make: Migration < /p>

Hier ist die Stapelverfolgung: < /p>

In Container.php line 274:

You have requested a non-existent service "doctrine". Did you mean one of these: "console.command.public_alias.doctrine_cache.contains_command", "console.command.public
_alias.doctrine_cache.delete_command", "console.command.public_alias.doctrine_cache.flush_command", "console.command.public_alias.doctrine_cache.stats_command", "consol
e.command.public_alias.doctrine_migrations.diff_command", "console.command.public_alias.doctrine_migrations.execute_command", "console.command.public_alias.doctrine_mig
rations.generate_command", "console.command.public_alias.doctrine_migrations.latest_command", "console.command.public_alias.doctrine_migrations.migrate_command", "conso
le.command.public_alias.doctrine_migrations.status_command", "console.command.public_alias.doctrine_migrations.version_command"?

Exception trace:
Symfony\Component\DependencyInjection\Container->make() at /opt/www/jame/dataneo-erp/vendor/symfony/dependency-injection/Container.php:222
Symfony\Component\DependencyInjection\Container->get() at /opt/www/jame/dataneo-erp/vendor/doctrine/doctrine-migrations-bundle/Command/Helper/DoctrineCommandHelper.php:21
Doctrine\Bundle\MigrationsBundle\Command\Helper\DoctrineCommandHelper::setApplicationHelper() at /opt/www/jame/dataneo-erp/vendor/doctrine/doctrine-migrations-bundle/Command/MigrationsDiffDoctrineCommand.php:34
Doctrine\Bundle\MigrationsBundle\Command\MigrationsDiffDoctrineCommand->execute() at /opt/www/jame/dataneo-erp/vendor/symfony/console/Command/Command.php:251
Symfony\Component\Console\Command\Command->run() at /opt/www/jame/dataneo-erp/vendor/symfony/maker-bundle/src/Maker/MakeMigration.php:78
Symfony\Bundle\MakerBundle\Maker\MakeMigration->generate() at /opt/www/jame/dataneo-erp/vendor/symfony/maker-bundle/src/Command/MakerCommand.php:100
Symfony\Bundle\MakerBundle\Command\MakerCommand->execute() at /opt/www/jame/dataneo-erp/vendor/symfony/console/Command/Command.php:251
Symfony\Component\Console\Command\Command->run() at /opt/www/jame/dataneo-erp/vendor/symfony/console/Application.php:904
Symfony\Component\Console\Application->doRunCommand() at /opt/www/jame/dataneo-erp/vendor/symfony/framework-bundle/Console/Application.php:89
Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /opt/www/jame/dataneo-erp/vendor/symfony/console/Application.php:262
Symfony\Component\Console\Application->doRun() at /opt/www/jame/dataneo-erp/vendor/symfony/framework-bundle/Console/Application.php:75
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /opt/www/jame/dataneo-erp/vendor/symfony/console/Application.php:145
Symfony\Component\Console\Application->run() at /opt/www/jame/dataneo-erp/bin/console:39
< /code>

Hier ist der Code einiger Konfigurationsdateien: < /p>

services.yaml

# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.

# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_pr ... figuration
parameters:
locale: 'fr'

services:
autowire: true
autoconfigure: true
public: false

App\:
resource: '../src/*'
exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'

App\Controller\:
resource: '../src/Controller'
tags: ['controller.service_arguments']
< /code>

config/packages/doctrine.yaml

parameters:
env(DATABASE_URL): ''

doctrine:
dbal:
driver: 'pdo_pgsql'
server_version: '10.5'
charset: utf8mb4
default_table_options:
charset: utf8mb4
collate: utf8mb4_unicode_ci

url: '%env(resolve:DATABASE_URL)%'
orm:
auto_generate_proxy_classes: '%kernel.debug%'
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true
mappings:
App:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App
< /code>

und mein .env < /p>

APP_ENV=dev
APP_SECRET=secret
DATABASE_URL="pgsql://erp_dev:My_PASSWORD@127.0.0.1:5432/erp"
MAILER_URL=null://localhost
< /code>

Bearbeiten: < /p>

Ich habe versucht, "Dienste: öffentlich: true" in diensten.yaml wie in der zweiten Antwort erwähnt und das Ergebnis ist ein neuer Fehler: < /p>

In DefinitionErrorExceptionPass.php line 54:

[Symfony\Component\DependencyInjection\Exception\RuntimeException]
Cannot autowire service "App\Repository\SocieteRepository": argument "$registry" of method "__construct()" refer
ences interface "Symfony\Bridge\Doctrine\RegistryInterface" but no such service exists. Did you create a class t
hat implements this interface?

Exception trace:
Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass->processValue() at /opt/www/jame/dataneo-erp/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php:60
Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->processValue() at /opt/www/jame/dataneo-erp/vendor/symfony/dependency-injection/Compiler/DefinitionErrorExceptionPass.php:32
Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass->processValue() at /opt/www/jame/dataneo-erp/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php:39
Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->process() at /opt/www/jame/dataneo-erp/vendor/symfony/dependency-injection/Compiler/Compiler.php:95
Symfony\Component\DependencyInjection\Compiler\Compiler->compile() at /opt/www/jame/dataneo-erp/vendor/symfony/dependency-injection/ContainerBuilder.php:736
Symfony\Component\DependencyInjection\ContainerBuilder->compile() at /opt/www/jame/dataneo-erp/vendor/symfony/http-kernel/Kernel.php:519
Symfony\Component\HttpKernel\Kernel->initializeContainer() at /opt/www/jame/dataneo-erp/vendor/symfony/http-kernel/Kernel.php:123
Symfony\Component\HttpKernel\Kernel->boot() at /opt/www/jame/dataneo-erp/vendor/symfony/framework-bundle/Console/Application.php:65
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /opt/www/jame/dataneo-erp/vendor/symfony/console/Application.php:145
Symfony\Component\Console\Application->run() at /opt/www/jame/dataneo-erp/bin/console:39
< /code>

Hier ist das Ergebnis des Befehls < /p>

PHP Bin /Konsole Debug: C o n t a i n e r | G r e p - L e h r e < / p > < b r / > < b r / > < c o d e > c o n s o l e . c o m m a n d . p u b l i c _ a l i a s . d o c t r i n e _ c a c h e . c o n t a i n s _ c o m m a n d a l i a s f o r " d o c t r i n e _ c a c h e . c o n t a i n s _ c o m m a n d " < b r / > c o n s o l e . c o m m a n d . p u b l i c _ a l i a s . d o c t r i n e _ c a c h e . d e l e t e _ c o m m a n d a l i a s f o r " d o c t r i n e _ c a c h e . d e l e t e _ c o m m a n d " < b r / > c o n s o l e . c o m m a n d . p u b l i c _ a l i a s . d o c t r i n e _ c a c h e . f l u s h _ c o m m a n d a l i a s f o r " d o c t r i n e _ c a c h e . f l u s h _ c o m m a n d " < b r / > c o n s o l e . c o m m a n d . p u b l i c _ a l i a s . d o c t r i n e _ c a c h e . s t a t s _ c o m m a n d a l i a s f o r " d o c t r i n e _ c a c h e . s t a t s _ c o m m a n d " < b r / > c o n s o l e . c o m m a n d . p u b l i c _ a l i a s . d o c t r i n e _ m i g r a t i o n s . d i f f _ c o m m a n d a l i a s f o r " d o c t r i n e _ m i g r a t i o n s . d i f f _ c o m m a n d " < b r / > c o n s o l e . c o m m a n d . p u b l i c _ a l i a s . d o c t r i n e _ m i g r a t i o n s . e x e c u t e _ c o m m a n d a l i a s f o r " d o c t r i n e _ m i g r a t i o n s . e x e c u t e _ c o m m a n d " < b r / > c o n s o l e . c o m m a n d . p u b l i c _ a l i a s . d o c t r i n e _ m i g r a t i o n s . g e n e r a t e _ c o m m a n d a l i a s f o r " d o c t r i n e _ m i g r a t i o n s . g e n e r a t e _ c o m m a n d " < b r / > c o n s o l e . c o m m a n d . p u b l i c _ a l i a s . d o c t r i n e _ m i g r a t i o n s . l a t e s t _ c o m m a n d a l i a s f o r " d o c t r i n e _ m i g r a t i o n s . l a t e s t _ c o m m a n d " < b r / > c o n s o l e . c o m m a n d . p u b l i c _ a l i a s . d o c t r i n e _ m i g r a t i o n s . m i g r a t e _ c o m m a n d a l i a s f o r " d o c t r i n e _ m i g r a t i o n s . m i g r a t e _ c o m m a n d " < b r / > c o n s o l e . c o m m a n d . p u b l i c _ a l i a s . d o c t r i n e _ m i g r a t i o n s . s t a t u s _ c o m m a n d a l i a s f o r " d o c t r i n e _ m i g r a t i o n s . s t a t u s _ c o m m a n d " < b r / > c o n s o l e . c o m m a n d . p u b l i c _ a l i a s . d o c t r i n e _ m i g r a t i o n s . v e r s i o n _ c o m m a n d a l i a s f o r " d o c t r i n e _ m i g r a t i o n s . v e r s i o n _ c o m m a n d " < b r / > d o c t r i n e _ c a c h e . a b s t r a c t . a p c D o c t r i n e \ C o m m o n \ C a c h e \ A p c C a c h e < b r / > d o c t r i n e _ c a c h e . a b s t r a c t . a p c u D o c t r i n e \ C o m m o n \ C a c h e \ A p c u C a c h e < b r / > d o c t r i n e _ c a c h e . a b s t r a c t . a r r a y D o c t r i n e \ C o m m o n \ C a c h e \ A r r a y C a c h e < b r / > d o c t r i n e _ c a c h e . a b s t r a c t . c h a i n D o c t r i n e \ C o m m o n \ C a c h e \ C h a i n C a c h e < b r / > d o c t r i n e _ c a c h e . a b s t r a c t . c o u c h b a s e D o c t r i n e \ C o m m o n \ C a c h e \ C o u c h b a s e C a c h e < b r / > d o c t r i n e _ c a c h e . a b stract.file_system Doctrine\Common\Cache\FilesystemCache
doctrine_cache.abstract.memcache Doctrine\Common\Cache\MemcacheCache
doctrine_cache.abstract.memcached Doctrine\Common\Cache\MemcachedCache
doctrine_cache.abstract.mongodb Doctrine\Common\Cache\MongoDBCache
doctrine_cache.abstract.php_file Doctrine\Common\Cache\PhpFileCache
doctrine_cache.abstract.predis Doctrine\Common\Cache\PredisCache
doctrine_cache.abstract.redis Doctrine\Common\Cache\RedisCache
doctrine_cache.abstract.riak Doctrine\Common\Cache\RiakCache
doctrine_cache.abstract.sqlite3 Doctrine\Common\Cache\SQLite3Cache
doctrine_cache.abstract.void Doctrine\Common\Cache\VoidCache
doctrine_cache.abstract.wincache Doctrine\Common\Cache\WinCacheCache
doctrine_cache.abstract.xcache Doctrine\Common\Cache\XcacheCache
doctrine_cache.abstract.zenddata Doctrine\Common\Cache\ZendDataCache
doctrine_cache.contains_command Doctrine\Bundle\DoctrineCacheBundle\Command\ContainsCommand
doctrine_cache.delete_command Doctrine\Bundle\DoctrineCacheBundle\Command\DeleteCommand
doctrine_cache.flush_command Doctrine\Bundle\DoctrineCacheBundle\Command\FlushCommand
doctrine_cache.stats_command Doctrine\Bundle\DoctrineCacheBundle\Command\StatsCommand
doctrine_migrations.diff_command Doctrine\Bundle\MigrationsBundle\Command\MigrationsDiffDoctrineCommand
doctrine_migrations.execute_command Doctrine\Bundle\MigrationsBundle\Command\MigrationsExecuteDoctrineCommand
doctrine_migrations.generate_command Doctrine\Bundle\MigrationsBundle\Command\MigrationsGenerateDoctrineCommand
doctrine_migrations.latest_command Doctrine\Bundle\MigrationsBundle\Command\MigrationsLatestDoctrineCommand
doctrine_migrations.migrate_command Doctrine\Bundle\MigrationsBundle\Command\MigrationsMigrateDoctrineCommand
doctrine_migrations.status_command Doctrine\Bundle\MigrationsBundle\Command\MigrationsStatusDoctrineCommand
doctrine_migrations.version_command Doctrine\Bundle\MigrationsBundle\Command\MigrationsVersionDoctrineCommand
maker.doctrine_helper Symfony\Bundle\MakerBundle\Doctrine\DoctrineHelper
sensio_framework_extra.converter.doctrine.orm Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter
sensio_framework_extra.converter.doctrine.orm.expression_language alias for "sensio_framework_extra.converter.doctrine.orm.expression_language.default"
sensio_framework_extra.converter.doctrine.orm.expression_language.default Symfony\Component\ExpressionLanguage\ExpressionLanguage
< /code>

Vielen Dank. < /p>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post