mmucklo / DtcQueueBundle

Symfony2/3/4/5 Queue Bundle (for background jobs) supporting Mongo (Doctrine ODM), Mysql (and any Doctrine ORM), RabbitMQ, Beanstalkd, Redis, and ... {write your own}
MIT License
120 stars 38 forks source link

TypeError In DtcQueueListener.php line 31: #123

Closed klodoma closed 4 years ago

klodoma commented 4 years ago

I just upgraded to Symfony 4.4 and I am getting this error:

php bin/console dtc:queue:run -vvv

In DtcQueueListener.php line 31:

  [TypeError]
  Argument 1 passed to Dtc\QueueBundle\Doctrine\DtcQueueListener::setRegistry() must be an instance of Symfony\Bridge\Doctrine\RegistryInterface, i
  nstance of Doctrine\Bundle\DoctrineBundle\Registry given, called in D:\Projects\devCo\var\cache\dev\ContainerHCU9lHK\getDtcQueu
  e_DoctrineListenerService.php on line 16

Exception trace:
  at D:\Projects\devCo\vendor\mmucklo\queue-bundle\Doctrine\DtcQueueListener.php:31
 Dtc\QueueBundle\Doctrine\DtcQueueListener->setRegistry() at D:\Projects\devCo\var\cache\dev\ContainerHCU9lHK\getDtcQueue_DoctrineListenerService.php:16
 require() at D:\Projects\devCo\var\cache\dev\ContainerHCU9lHK\srcApp_KernelDevDebugContainer.php:576
 ContainerHCU9lHK\srcApp_KernelDevDebugContainer->load() at D:\Projects\devCo\vendor\symfony\dependency-injection\Container.php:444
 Symfony\Component\DependencyInjection\Container->getService() at D:\Projects\devCo\vendor\symfony\dependency-injection\Argument\ServiceLocator.php:40
 Symfony\Component\DependencyInjection\Argument\ServiceLocator->get() at D:\Projects\devCo\vendor\symfony\doctrine-bridge\ContainerAwareEventManager.php:143
 Symfony\Bridge\Doctrine\ContainerAwareEventManager->initializeListeners() at D:\Projects\devCo\vendor\symfony\doctrine-bridge\ContainerAwareEventManager.php:54
 Symfony\Bridge\Doctrine\ContainerAwareEventManager->dispatchEvent() at D:\Projects\devCo\vendor\doctrine\orm\lib\Doctrine\ORM\Event\ListenersInvoker.php:117
 Doctrine\ORM\Event\ListenersInvoker->invoke() at D:\Projects\devCo\vendor\doctrine\orm\lib\Doctrine\ORM\UnitOfWork.php:943
 Doctrine\ORM\UnitOfWork->persistNew() at D:\Projects\devCo\vendor\doctrine\orm\lib\Doctrine\ORM\UnitOfWork.php:1780
 Doctrine\ORM\UnitOfWork->doPersist() at D:\Projects\devCo\vendor\doctrine\orm\lib\Doctrine\ORM\UnitOfWork.php:1736
 Doctrine\ORM\UnitOfWork->persist() at D:\Projects\devCo\vendor\doctrine\orm\lib\Doctrine\ORM\EntityManager.php:607
 Doctrine\ORM\EntityManager->persist() at D:\Projects\devCo\vendor\mmucklo\queue-bundle\ORM\CommonTrait.php:124
 Dtc\QueueBundle\ORM\RunManager->persist() at D:\Projects\devCo\vendor\mmucklo\queue-bundle\Doctrine\DoctrineRunManager.php:101
 Dtc\QueueBundle\Doctrine\DoctrineRunManager->persistRun() at D:\Projects\devCo\vendor\mmucklo\queue-bundle\Manager\RunManager.php:124
 Dtc\QueueBundle\Manager\RunManager->runStart() at D:\Projects\devCo\vendor\mmucklo\queue-bundle\Run\Loop.php:124
 Dtc\QueueBundle\Run\Loop->runLoop() at D:\Projects\devCo\vendor\mmucklo\queue-bundle\Command\RunCommand.php:132
 Dtc\QueueBundle\Command\RunCommand->execute() at D:\Projects\devCo\vendor\symfony\console\Command\Command.php:255
 Symfony\Component\Console\Command\Command->run() at D:\Projects\devCo\vendor\symfony\console\Application.php:1029
 Symfony\Component\Console\Application->doRunCommand() at D:\Projects\devCo\vendor\symfony\framework-bundle\Console\Application.php:97
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at D:\Projects\devCo\vendor\symfony\console\Application.php:272
 Symfony\Component\Console\Application->doRun() at D:\Projects\devCo\vendor\symfony\framework-bundle\Console\Application.php:83
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at D:\Projects\devCo\vendor\symfony\console\Application.php:148
 Symfony\Component\Console\Application->run() at D:\Projects\devCo\bin\console:40

If I remove the RegistryInterface typeconstraint, seems to work.

Screenshot_490

Any ideas?

klodoma commented 4 years ago

It has to do something with doctrine/doctrine-bundle > 2.0

If I enforce this in composer.json, then it works "doctrine/doctrine-bundle": "^1.12",

mmucklo commented 4 years ago

@klodoma looks like I'll need to update the libraries on this bundle for 4.4 compatibility. Thanks for the heads up.

mmucklo commented 4 years ago

@klodoma - Should be fixed as of version 6.0.3