I have this error when i try to run my controller url. Please help me solve this issue, i am very appreciate it.
Exception #0 (LogicException): Circular dependency: Rakuten\ProductAPI\Model\ProductModel depends on Rakuten\ProductAPI\Model\ProductModel and vice versa. Exception #0 (LogicException): Circular dependency: Rakuten\ProductAPI\Model\ProductModel depends on Rakuten\ProductAPI\Model\ProductModel and vice versa. <pre>#1 Magento\Framework\ObjectManager\ObjectManager->get() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170] #2 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276] #3 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239] #4 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34] #5 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59] #6 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70] #7 Magento\Framework\ObjectManager\ObjectManager->get() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170] #8 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276] #9 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239] #10 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34] #11 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59] #12 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:56] #13 Magento\Framework\ObjectManager\ObjectManager->create() called at [vendor/magento/framework/App/ActionFactory.php:44] #14 Magento\Framework\App\ActionFactory->create() called at [vendor/magento/framework/App/Router/Base.php:306] #15 Magento\Framework\App\Router\Base->matchAction() called at [vendor/magento/framework/App/Router/Base.php:167] #16 Magento\Framework\App\Router\Base->match() called at [vendor/magento/framework/Interception/Interceptor.php:58] #17 Magento\Framework\App\Router\Base\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138] #18 Magento\Framework\App\Router\Base\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153] #19 Magento\Framework\App\Router\Base\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/Router/Base/Interceptor.php:23] #20 Magento\Framework\App\Router\Base\Interceptor->match() called at [vendor/magento/framework/App/FrontController.php:144] #21 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58] #22 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138] #23 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php:99] #24 Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135] #25 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php:71] #26 Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135] #27 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153] #28 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:23] #29 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:116] #30 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23] #31 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:264] #32 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:30] </pre>
Hello @annq3sivn4281
This issue belongs to di.xml preference declaration.
You can take reference of below url:
https://magento.stackexchange.com/questions/94917/magento2-circular-depedency-when-reading-config
It may help you.
Thank you.