Frequently Asked Questions

Cannot instantiate abstract class Magento\\Framework\\Model\\ResourceModel\\AbstractResource
Last Updated 2 years ago

Review your modules constructor; chances are you added an additional class argument to the constructor and you added it in a wrong order.

you can read more about the problem at this link.Sample Constructors
Wrong Constructor
public function __construct(
\Magento\Framework\Model\Context $context,
\Magento\Framework\Registry $registry,
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
\Magento\Customer\Model\Session $customerSession, // this was added
array $data = []
) {


Correct Constructor
public function __construct(
\Magento\Framework\Model\Context $context,
\Magento\Framework\Registry $registry,
\CollinsHarper\Moneris\Helper\Data $helper,
\Magento\Customer\Model\Session $customerSession, // this was moved
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
array $data = []
) {

Please Wait!

Please wait... it will take a second!