Magento 2 getting error while creating ui_component

TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given in /var/www/html/vendor/magento/framework/Code/Reader/ClassReader.php:98
Stack trace:
#0 /var/www/html/vendor/magento/framework/Code/Reader/ClassReader.php(98): get_parent_class()
#1 /var/www/html/vendor/magento/framework/View/Element/UiComponent/Argument/Interpreter/ConfigurableObject.php(142): Magento\Framework\Code\Reader\ClassReader->getParents()
#2 /var/www/html/vendor/magento/framework/View/Element/UiComponent/Argument/Interpreter/ConfigurableObject.php(105): Magento\Framework\View\Element\UiComponent\Argument\Interpreter\ConfigurableObject->getParents()
#3 /var/www/html/generated/code/Magento/Framework/Data/Argument/InterpreterInterface/Proxy.php(95): Magento\Framework\View\Element\UiComponent\Argument\Interpreter\ConfigurableObject->evaluate()
#4 /var/www/html/vendor/magento/framework/Data/Argument/Interpreter/Composite.php(61): Magento\Framework\Data\Argument\InterpreterInterface\Proxy->evaluate()
#5 /var/www/html/vendor/magento/module-ui/Config/Data.php(164): Magento\Framework\Data\Argument\Interpreter\Composite->evaluate()
#6 /var/www/html/vendor/magento/module-ui/Config/Data.php(167): Magento\Ui\Config\Data->evaluateComponentArguments()
#7 /var/www/html/vendor/magento/module-ui/Config/Data.php(111): Magento\Ui\Config\Data->evaluateComponentArguments()
#8 /var/www/html/vendor/magento/module-ui/Config/Data.php(136): Magento\Ui\Config\Data->initData()
#9 /var/www/html/vendor/magento/framework/View/Layout/Reader/UiComponent.php(100): Magento\Ui\Config\Data->get()
#10 /var/www/html/vendor/magento/framework/View/Layout/ReaderPool.php(105): Magento\Framework\View\Layout\Reader\UiComponent->interpret()
#11 /var/www/html/vendor/magento/framework/View/Layout/Reader/Container.php(84): Magento\Framework\View\Layout\ReaderPool->interpret()
#12 /var/www/html/vendor/magento/framework/View/Layout/ReaderPool.php(105): Magento\Framework\View\Layout\Reader\Container->interpret()
#13 /var/www/html/vendor/magento/framework/View/Page/Config/Reader/Body.php(68): Magento\Framework\View\Layout\ReaderPool->interpret()
#14 /var/www/html/vendor/magento/framework/View/Layout/ReaderPool.php(105): Magento\Framework\View\Page\Config\Reader\Body->interpret()
#15 /var/www/html/vendor/magento/framework/View/Layout.php(346): Magento\Framework\View\Layout\ReaderPool->interpret()
#16 /var/www/html/generated/code/Magento/Framework/View/Layout/Interceptor.php(32): Magento\Framework\View\Layout->generateElements()
#17 /var/www/html/vendor/magento/framework/View/Layout/Builder.php(129): Magento\Framework\View\Layout\Interceptor->generateElements()
#18 /var/www/html/vendor/magento/framework/View/Page/Builder.php(65): Magento\Framework\View\Layout\Builder->generateLayoutBlocks()
#19 /var/www/html/vendor/magento/framework/View/Layout/Builder.php(65): Magento\Framework\View\Page\Builder->generateLayoutBlocks()
#20 /var/www/html/vendor/magento/framework/View/Layout.php(271): Magento\Framework\View\Layout\Builder->build()
#21 /var/www/html/vendor/magento/framework/View/Layout.php(896): Magento\Framework\View\Layout->build()
#22 /var/www/html/vendor/magento/module-backend/Model/View/Result/Page.php(26): Magento\Framework\View\Layout->getBlock()
#23 /var/www/html/app/code/Codecryption/Inventory/Controller/Adminhtml/codecryption/Csvimport.php(37): Magento\Backend\Model\View\Result\Page->setActiveMenu()
#24 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Codecryption\Inventory\Controller\Adminhtml\codecryption\Csvimport->execute()
#25 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Codecryption\Inventory\Controller\Adminhtml\codecryption\Csvimport\Interceptor->___callParent()
#26 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Codecryption\Inventory\Controller\Adminhtml\codecryption\Csvimport\Interceptor->Magento\Framework\Interception\{closure}()
#27 /var/www/html/generated/code/Codecryption/Inventory/Controller/Adminhtml/codecryption/Csvimport/Interceptor.php(23): Codecryption\Inventory\Controller\Adminhtml\codecryption\Csvimport\Interceptor->___callPlugins()
#28 /var/www/html/vendor/magento/framework/App/Action/Action.php(111): Codecryption\Inventory\Controller\Adminhtml\codecryption\Csvimport\Interceptor->execute()
#29 /var/www/html/vendor/magento/module-backend/App/AbstractAction.php(151): Magento\Framework\App\Action\Action->dispatch()
#30 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Backend\App\AbstractAction->dispatch()
#31 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Codecryption\Inventory\Controller\Adminhtml\codecryption\Csvimport\Interceptor->___callParent()
#32 /var/www/html/app/code/WeltPixel/Backend/Plugin/Utility.php(76): Codecryption\Inventory\Controller\Adminhtml\codecryption\Csvimport\Interceptor->Magento\Framework\Interception\{closure}()
#33 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(135): WeltPixel\Backend\Plugin\Utility->aroundDispatch()
#34 /var/www/html/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(145): Codecryption\Inventory\Controller\Adminhtml\codecryption\Csvimport\Interceptor->Magento\Framework\Interception\{closure}()
#35 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch()
#36 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Codecryption\Inventory\Controller\Adminhtml\codecryption\Csvimport\Interceptor->Magento\Framework\Interception\{closure}()
#37 /var/www/html/generated/code/Codecryption/Inventory/Controller/Adminhtml/codecryption/Csvimport/Interceptor.php(32): Codecryption\Inventory\Controller\Adminhtml\codecryption\Csvimport\Interceptor->___callPlugins()
#38 /var/www/html/vendor/magento/framework/App/FrontController.php(245): Codecryption\Inventory\Controller\Adminhtml\codecryption\Csvimport\Interceptor->dispatch()
#39 /var/www/html/vendor/magento/framework/App/FrontController.php(212): Magento\Framework\App\FrontController->getActionResponse()
#40 /var/www/html/vendor/magento/framework/App/FrontController.php(147): Magento\Framework\App\FrontController->processRequest()
#41 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch()
#42 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent()
#43 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}()
#44 /var/www/html/generated/code/Magento/Framework/App/FrontController/Interceptor.php(23): Magento\Framework\App\FrontController\Interceptor->___callPlugins()
#45 /var/www/html/vendor/magento/framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch()
#46 /var/www/html/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http->launch()
#47 /var/www/html/pub/index.php(30): Magento\Framework\App\Bootstrap->run()
#48 {main}
Solution : 
in my case, the problem was that the class path was incorrectly specified.Go to your ui_component file and in < dataSource > check < argument name="class" >This should be the class path!< /argument> I corrected it to the correct one and it worked for me. If this helped you - let me know
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply