Class Magento\Authorization\Model\Acl\Role\GroupFactory does not exist in Magento2.x

Some time in Magento2.x we may get error message as like below on browser or in a log files.

Magento\Authorization\Model\Acl\Role\GroupFactory does not exist#0 /var/www/bfl/htdocs/vendor/magento/framework/ObjectManager/Definition/Runtime.php(44): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\\Authori...')#1 /var/www/bfl/htdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(71): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('Magento\\Authori...')#2 /var/www/bfl/htdocs/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Authori...')#3 /var/www/bfl/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(236): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Authori...')#4 /var/www/bfl/htdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'roleLoader', 'Magento\\Framewo...')#5 /var/www/bfl/htdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Framewo...', Array, Array)#6 /var/www/bfl/htdocs/vendor/magento/framework/ObjectManager/ObjectManager.php

 

Solution:

When you get this kind of error just run deploy & remove cache & pub folder and provide necessary write permission for pub and var.

1. root> php bin/magento setup:static-content:deploy

2. root> sudo rm -rf var/cache/* var/page_cache/* var/view_preprocessed/* var/generation/* pub/static/*

3. Give write permisson for var & pub

Save Environment !

Leave a Reply