1

error:
a:4:{i:0;s:68:"Class namespace\modulename\Controller\CustomLoginPost does not exist";i:1;s:6711:"#0 C:\xampp2\htdocs\magento2\lib\internal\Magento\Framework\Code\Reader\ClassReader.php(19): ReflectionClass->__construct('namespace\modulename...')

di.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
    <preference for="Magento\Customer\Controller\Account\LoginPost" type="namespace\modulename\Controller\Account\CustomLoginPost" /> 
</config>

anyone can help? I have checked the path is correct, the module is enabled.

2

First your di.xml check for xsi:noNamespaceSchemaLocation value. in magento 2 latest CE, xml value are changed.Your di.xml contains old value.

Your config tag look like below:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">

set above line in di.xml file. Framework folder files and magento core module are reside in root/vendor/magento folder. So keep path updated in your di file.

Thanks.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.