jkowens/magento-jobqueue

The class DJJob does not exist.

Closed this issue · 3 comments

I installed the jobqueue via Composer using magento-hackathon/magento-composer-installer.
When I try to run the cron job, I get the error below. I can see seatgeek/djjob in the vendor directory.

Can I get guidance where to look for possible mistakes?

bin/n98-magerun.phar sys:cr:ru jobqueue_default -v

[Mage_Core_Exception]
The class DJJob does not exist. Please add the class to /lib/DJJob/DJJob.php OR install DJJob via magento-composer-installer. See https://github.com/jkowens/magento-jobqueue for more de
tails.

Exception trace:
() at /vagrant/public/app/Mage.php:605
Mage::throwException() at /vagrant/vendor/inviqa/worldpay-module/vendor/jkowens/magento-jobqueue/app/code/community/Jowens/JobQueue/Model/Worker.php:7
include() at phar:///vagrant/bin/n98-magerun.phar/vendor/composer/ClassLoader.php:412
Composer\Autoload\includeFile() at phar:///vagrant/bin/n98-magerun.phar/vendor/composer/ClassLoader.php:301
Composer\Autoload\ClassLoader->loadClass() at n/a:n/a
spl_autoload_call() at n/a:n/a
class_exists() at /vagrant/public/app/code/core/Mage/Core/Model/Config.php:1346
Mage_Core_Model_Config->getModelInstance() at /vagrant/public/app/Mage.php:473
Mage::getModel() at phar:///vagrant/bin/n98-magerun.phar/src/N98/Magento/Command/System/Cron/RunCommand.php:67
N98\Magento\Command\System\Cron\RunCommand->execute() at phar:///vagrant/bin/n98-magerun.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
Symfony\Component\Console\Command\Command->run() at phar:///vagrant/bin/n98-magerun.phar/src/N98/Magento/Command/AbstractMagentoCommand.php:445
N98\Magento\Command\AbstractMagentoCommand->run() at phar:///vagrant/bin/n98-magerun.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:882
Symfony\Component\Console\Application->doRunCommand() at phar:///vagrant/bin/n98-magerun.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:195
Symfony\Component\Console\Application->doRun() at phar:///vagrant/bin/n98-magerun.phar/src/N98/Magento/Application.php:581
N98\Magento\Application->doRun() at phar:///vagrant/bin/n98-magerun.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:126
Symfony\Component\Console\Application->run() at phar:///vagrant/bin/n98-magerun.phar/src/N98/Magento/Application.php:641
N98\Magento\Application->run() at /vagrant/bin/n98-magerun.phar:8

sys:cron:run [job]

It sounds like DJJob files are not being symlinked or copied from the vendor directory into your Magento project. I'm not very familiar with Composer, so I would start with just copying the DJJob directory into your project's lib directory and see if that resolves the error. If you figure out a way to automate that with Composer please let me know!

You might want to switch magento-hackathon/magento-composer-installer for Cotya/magento-composer-installer because it is more up-to-date and feature rich. I believe that it uses a different way of including composer into magento. This is needed for jobque to include Djjob. I am using this without any issues.

Thanks guys for the quick reply.

It was my fault. I'm developing a Magento extension and the project has 2 vendor directories one for Magento and one for my extension. And I run composer update only within the extension directory, so the main vendor directory did not get the update.
Now it's working fine.