Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReflectionException: Class "Flekto\Postcode\Helper\Magento\Framework\App\ProductMetadataInterface" #81

Open
jvkranenburg opened this issue Jun 12, 2023 · 2 comments

Comments

@jvkranenburg
Copy link

Hi, we have installed the latest version of this extension by Composer.

After installing we ran:

bin/magento set:up && bin/magento s:d:c && bin/magento s:s:d -f nl_NL en_GB en_US --jobs=8 && bin/magento cache:cl && bin/magento cache:fl

And we get a "ReflectionException: Class "Flekto\Postcode\Helper\Magento\Framework\App\ProductMetadataInterface"".

On frontend everything is visible (OneStepCheckout.com integrated) but trying to find an address shows:
image

In the exception.log file the log below is written. Does anyone know what I'm doing wrong?

[2023-06-10T21:16:11.677044+00:00] main.CRITICAL: ReflectionException: Class "Flekto\Postcode\Helper\Magento\Framework\App\ProductMetadataInterface" does not exist in /home/xyx.nl/public_html/vendor/magento/framework/Code/Reader/ClassReader.php:34
Stack trace:
#0 /home/xyx.nl/public_html/vendor/magento/framework/Code/Reader/ClassReader.php(34): ReflectionClass->__construct()
#1 /home/xyx.nl/public_html/vendor/magento/framework/ObjectManager/Definition/Runtime.php(54): Magento\Framework\Code\Reader\ClassReader->getConstructor()
#2 /home/xyx.nl/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(100): Magento\Framework\ObjectManager\Definition\Runtime->getParameters()
#3 /home/xyx.nl/public_html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Compiled->create()
#4 /home/xyx.nl/public_html/vendor/postcode-nl/api-magento2-module/Helper/ApiClientHelper.php(463): Magento\Framework\ObjectManager\ObjectManager->get()
#5 /home/xyx.nl/public_html/vendor/postcode-nl/api-magento2-module/Helper/ApiClientHelper.php(273): Flekto\Postcode\Helper\ApiClientHelper->_getDebugInfo()
#6 /home/xyx.nl/public_html/vendor/postcode-nl/api-magento2-module/Helper/ApiClientHelper.php(205): Flekto\Postcode\Helper\ApiClientHelper->_handleClientException()
#7 /home/xyx.nl/public_html/vendor/postcode-nl/api-magento2-module/Model/PostcodeModel.php(62): Flekto\Postcode\Helper\ApiClientHelper->getNlAddress()
#8 [internal function]: Flekto\Postcode\Model\PostcodeModel->getNlAddress()
#9 /home/xyx.nl/public_html/vendor/magento/module-webapi/Controller/Rest/SynchronousRequestProcessor.php(95): call_user_func_array()
#10 /home/xyx.nl/public_html/vendor/magento/module-webapi/Controller/Rest.php(202): Magento\Webapi\Controller\Rest\SynchronousRequestProcessor->process()
#11 /home/xyx.nl/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest->dispatch()
#12 /home/xyx.nl/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\Interceptor->___callParent()
#13 /home/xyx.nl/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception\{closure}()
#14 /home/xyx.nl/public_html/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(23): Magento\Webapi\Controller\Rest\Interceptor->___callPlugins()
#15 /home/xyx.nl/public_html/vendor/magento/framework/App/Http.php(116): Magento\Webapi\Controller\Rest\Interceptor->dispatch()
#16 /home/xyx.nl/public_html/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch()
#17 /home/xyx.nl/public_html/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
#18 /home/xyx.nl/public_html/pub/index.php(43): Magento\Framework\App\Bootstrap->run()
#19 {main}

Next Exception: Report ID: webapi-6484e81ba5290; Message: Class "Flekto\Postcode\Helper\Magento\Framework\App\ProductMetadataInterface" does not exist in /home/xyx.nl/public_html/vendor/magento/framework/Webapi/ErrorProcessor.php:208
Stack trace:
#0 /home/xyx.nl/public_html/vendor/magento/framework/Webapi/ErrorProcessor.php(153): Magento\Framework\Webapi\ErrorProcessor->_critical()
#1 /home/xyx.nl/public_html/vendor/magento/module-webapi/Controller/Rest.php(208): Magento\Framework\Webapi\ErrorProcessor->maskException()
#2 /home/xyx.nl/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest->dispatch()
#3 /home/xyx.nl/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\Interceptor->___callParent()
#4 /home/xyx.nl/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception\{closure}()
#5 /home/xyx.nl/public_html/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(23): Magento\Webapi\Controller\Rest\Interceptor->___callPlugins()
#6 /home/xyx.nl/public_html/vendor/magento/framework/App/Http.php(116): Magento\Webapi\Controller\Rest\Interceptor->dispatch()
#7 /home/xyx.nl/public_html/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch()
#8 /home/xyx.nl/public_html/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
#9 /home/xyx.nl/public_html/pub/index.php(43): Magento\Framework\App\Bootstrap->run()
#10 {main} {"exception":"[object] (Exception(code: -1): Report ID: webapi-6484e81ba5290; Message: Class \"Flekto\\Postcode\\Helper\\Magento\\Framework\\App\\ProductMetadataInterface\" does not exist at /home/xyx.nl/public_html/vendor/magento/framework/Webapi/ErrorProcessor.php:208)
[previous exception] [object] (ReflectionException(code: -1): Class \"Flekto\\Postcode\\Helper\\Magento\\Framework\\App\\ProductMetadataInterface\" does not exist at /home/xyx.nl/public_html/vendor/magento/framework/Code/Reader/ClassReader.php:34)"} []
@JSeverein
Copy link

We had the same. It appears to be caused by a missing \ here: https://github.com/postcode-nl/PostcodeNl_Api_Magento2/blob/master/Helper/ApiClientHelper.php#LL463C28-L463C28

A workaround is to turn off debug mode in the admin.

@jvkranenburg
Copy link
Author

Thx Jeroen! That's it! Switched off Debug mode for now ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants