I have a custom module to expose an API to get the best selling products & most viewed products separately.
This module is working fine in my localhost and staging server. When i moved the same code to production server i am getting an error like below.
“Fatal Error: ‘Uncaught Error: Cannot instantiate interface AyakilInsightsApiProductSlidersManagementInterface in /chroot/home/aee9c6e2/aaa2d0443a.nxcli.net/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111nStack trace:n#0 /chroot/home/aee9c6e2/aaa2d0443a.nxcli.net/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): MagentoFrameworkObjectManagerFactoryAbstractFactory->createObject(‘Ayakil\Insig…’, Array)n#1 /chroot/home/aee9c6e2/aaa2d0443a.nxcli.net/vendor/magento/framework/ObjectManager/ObjectManager.php(70): MagentoFrameworkObjectManagerFactoryCompiled->create(‘Ayakil\Insig…’)n#2 /chroot/home/aee9c6e2/aaa2d0443a.nxcli.net/vendor/magento/module-webapi/Controller/Rest.php(328): MagentoFrameworkObjectManagerObjectManager->get(‘Ayakil\Insig…’)n#3 /chroot/home/aee9c6e2/aaa2d0443a.nxcli.net/vendor/magento/module-webapi/Controller/Rest.php(239): MagentoWebapiControllerRest->processApiRequest()n#4 /chroot/home/aee9c6e2/aaa2d0443a.nxcli.net/vendor/magent’ in ‘/chroot/home/aee9c6e2/aaa2d0443a.nxcli.net/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php’ on line 111”
My custom modules di.xml file is below.
My ProductSlidersManagement.php file is below.
<?php
namespace AyakilInsightsApi;
interface ProductSlidersManagementInterface
{
/**
* Get Bestseller Product Slider api
* @return AyakilInsightsApiDataProductSlidersInterface
*/
public function getBestseller();
}
Please help me to fix this issue.