Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3924

After upgrading symfony from 3.4 to 4.4(without flex) getting service or alias has been removed or inlined when the container was compiled

$
0
0

After updating symfony from 3.4 to 4.4(without flex) i am getting this error The "tactician.commandbus" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead.

I am injecting depnedeicies to controller using jms/di-extra-bundle

class MngmtController extends AbstractFOSRestController{   /**     * @var CommandBus     */    private $commandBus;    /**     * @var CommandBus     */    private $mngmtCommandBus;    /**     * @var LoggerInterface     */    private $logger;    /**     * @var MngmtService     */    private $mngmtService;    /**     * @param ContainerInterface $container     * @param CommandBus         $commandBus     * @param CommandBus         $mngmtCommandBus     * @param LoggerInterface    $logger     * @param MngmtService       $mngmtService     *     * @DI\InjectParams({     *     "container" = @DI\Inject("service_container"),     *     "commandBus" = @DI\Inject("tactician.commandbus"),     *     "mngmtCommandBus" = @DI\Inject("tactician.commandbus.mngmt"),     *     "logger" = @DI\Inject("monolog.logger"),     *     "mngmtService" = @DI\Inject("app.services.mngmt_service"),     * })     */    public function __construct(        ContainerInterface $container,        CommandBus $commandBus,        CommandBus $mngmtCommandBus,        LoggerInterface $logger        MngmtService $mngmtService,    ) {        $this->container = $container;        $this->commandBus = $commandBus;        $this->mngmtCommandBus = $mngmtCommandBus;        $this->logger = $logger;        $this->mngmtService = $mngmtService;    }

I have tried adding this in services.yml, but didn't help

   _defaults:        public: true    League\Tactician\CommandBus:        alias: 'tactician.commandbus'        public: true    Psr\Log\LoggerInterface:        alias: 'monolog.logger'        public: true

I am following older directory structure not updated to sf4/flex directory structure, Please help me with the above error


Viewing all articles
Browse latest Browse all 3924

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>