Skip to content

Error: Cannot instantiate abstract class MagentoFrameworkModelResourceModelAbstractResource

I have Magento enterprise version 2.4.5-p1, I am getting following error in the system.log

Error:- .CRITICAL: Error: Cannot instantiate abstract class
MagentoFrameworkModelResourceModelAbstractResource in
/var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121

I thought the issue is in this constructor parameter code which I have overridden from default Magento RMA’s Model,

public function __construct(
    MagentoFrameworkModelContext $context,
    MagentoFrameworkRegistry $registry,
    MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
    AttributeValueFactory $customAttrFactory,
    MagentoStoreModelStoreManagerInterface $storeManager,
    MagentoRmaModelRmaFactory $rmaFactory,
    MagentoRmaModelConfig $rmaConfig,
    MagentoFrameworkMailTemplateTransportBuilder $transportBuilder,
    MagentoFrameworkStdlibDateTimeDateTime $dateTimeDateTime,
    MagentoFrameworkTranslateInlineStateInterface $inlineTranslation,
    MagentoRmaHelperData $rmaHelper,
    TimezoneInterface $localeDate,
    RmaRepositoryInterface $rmaRepoInterface,
    RmaAttributesManagementInterface $metadataService,
    AddressRenderer $addressRenderer,
    RmaEntityFactory $customReturn,
    MagentoFrameworkModelResourceModelAbstractResource $resource = null,
    MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
    array $data = []
) {
    parent::__construct(
        $context,
        $registry,
        $extensionFactory,
        $customAttrFactory,
        $storeManager,
        $rmaFactory,
        $rmaConfig,
        $transportBuilder,
        $dateTimeDateTime,
        $inlineTranslation,
        $rmaHelper,
        $localeDate,
        $rmaRepoInterface,
        $metadataService,
        $addressRenderer,
        $resource,
        $resourceCollection,
        $data
    );
    $this->storeManager = $storeManager;
    $this->rmaConfig = $rmaConfig;
    $this->transportBuilder = $transportBuilder;
    $this->inlineTranslation = $inlineTranslation;
    $this->rmaHelper = $rmaHelper;
    $this->addressRenderer = $addressRenderer;
    $this->customReturn = $customReturn;
}

Can anyone have idea, where am I doing wrong ?

Thanks in advance