ServiceNotFoundException' 'Unable to resolve service "Router" to a factory - php

i'm using zend framework 3 with doctrine 2 and it giving me this error i dnt know why
Fatal error: Uncaught exception
'Zend\ServiceManager\Exception\ServiceNotFoundException' with message
'Unable to resolve service "Router" to a factory; are you certain you
provided it during configuration?' in
C:\xampp\htdocs\zendf\vendor\zendframework\zend-servicemanager\src\ServiceManager.php:681
Stack trace: #0
C:\xampp\htdocs\zendf\vendor\zendframework\zend-servicemanager\src\ServiceManager.php(757):
Zend\ServiceManager\ServiceManager->getFactory('Router') #1
C:\xampp\htdocs\zendf\vendor\zendframework\zend-servicemanager\src\ServiceManager.php(200):
Zend\ServiceManager\ServiceManager->doCreate('Router') #2
C:\xampp\htdocs\zendf\vendor\zendframework\zend-mvc\src\Application.php(158):
Zend\ServiceManager\ServiceManager->get('Router') #3
C:\xampp\htdocs\zendf\vendor\zendframework\zend-mvc\src\Application.php(273):
Zend\Mvc\Application->bootstrap(Array) #4
C:\xampp\htdocs\zendf\public\index.php(40):
Zend\Mvc\Application::init(Array) #5 {main} thrown in
C:\xampp\htdocs\zendf\vendor\zendframework\zend-servicemanager\src\ServiceManager.php
on line 681

I got the same problem while upgrading an app from zf2 to zf3.
I solved the problem by loading the module Zend\Router. There are some more modules coming with ZF3, so I ended up using this in the modules.config.php:
return [
'Zend\Cache',
'Zend\Form',
'Zend\Hydrator',
'Zend\InputFilter',
'Zend\Paginator',
'Zend\I18n',
'Zend\Filter',
'Zend\Router',
'Zend\Validator',
'Zend\Navigation',
...
];
I got the modules.config.php and the new application.config.php from the zf3 skeleton application.

Related

ReflectionClass error. in Upgrading laravel 5.1 to 5.8

I am following https://medium.com/#info.subashthapa/upgrading-laravel-5-0-to-5-8-1bfec5c8a0e2
to upgrade laravel 5.1 to laravel 5.8 now I have stuck in that error
PHP Fatal error: Uncaught ReflectionException: Class App\Console\Kernel does not exist in D:\xampp\htdocs\cloud\vendor\laravel\framework\src\Illuminate\Container\Container.php:741
Stack trace:
#0 D:\xampp\htdocs\cloud\vendor\laravel\framework\src\Illuminate\Container\Container.php(741): ReflectionClass->__construct('App\\Console\\Ker...')
#1 D:\xampp\htdocs\cloud\vendor\laravel\framework\src\Illuminate\Container\Container.php(631): Illuminate\Container\Container->build('App\\Console\\Ker...', Array)
#2 D:\xampp\htdocs\cloud\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(674): Illuminate\Container\Container->make('App\\Console\\Ker...', Array)
#3 D:\xampp\htdocs\cloud\vendor\laravel\framework\src\Illuminate\Container\Container.php(220): Illuminate\Foundation\Application->make('App\\Console\\Ker...', Array)
#4 D:\xampp\htdocs\cloud\vendor\laravel\framework\src\Illuminate\Container\Container.php(738): Illuminate\Container\Container->Illuminate\Container\{closure}(Object(Illuminat in D:\xampp\htdocs\cloud\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 741
I have found out ReflectionClass; in fresh laravel 5.8 but I didn't get.
I download composer.json from server I surprised its file got invalid json. I don't know how it happens.
I tried copy composer.json to replace old composer.json still I got error ReflectionClass error.
Please Suggest me.

Magento 2 Installation fails at 27%

I have this exception when running the installation for Magento 2. Couldn't find further information on how to fix this anywhere, error thrown was not very clear either. Anyone has any ideas? This happens after it says 'Running schema recurring...'
Module 'Magento_Amqp':
[ERROR] LogicException: Request schema definition for topic "shared.catalog.product.price.updated" should reference existing service class. Given "Magento\AsynchronousOperations\Api\Data\OperationInterface" in /var/www/tpb.com/html/vendor/magento/framework/Communication/Config/Validator.php:71
Stack trace:
#0 /var/www/tpb.com/html/vendor/magento/framework/Communication/Config/Reader/XmlReader/Converter.php(204): Magento\Framework\Communication\Config\Validator->validateRequestSchemaType('Magento\\Asynchr...', 'shared.catalog....')
#1 /var/www/tpb.com/html/vendor/magento/framework/Communication/Config/Reader/XmlReader/Converter.php(111): Magento\Framework\Communication\Config\Reader\XmlReader\Converter->extractTopicRequestSchema(Object(DOMElement))
#2 /var/www/tpb.com/html/vendor/magento/framework/Communication/Config/Reader/XmlReader/Converter.php(84): Magento\Framework\Communication\Config\Reader\XmlReader\Converter->extractTopics(Object(DOMDocument))
#3 /var/www/tpb.com/html/vendor/magento/framework/Config/Reader/Filesystem.php(171): Magento\Framework\Communication\Config\Reader\XmlReader\Converter->convert(Object(DOMDocument))
...

Lumen 5.3 & PHP 7: Symfony Error ExceptionHandler

We have a project that uses Lumen 5.3, however when we always install PHP7 on the server it gives this error:
[Symfony\Component\Debug\Exception\FatalErrorException]
Uncaught TypeError: Argument 1 passed to Symfony\Component\Debug\ExceptionHandler::handle() must be an instance of Exception, instance of Error given in /var/www/retail-api/vendor/symfony/symfony/src/Symfony/Component/Debug/Excepti
onHandler.php:105
Stack trace:
#0 [internal function]: Symfony\Component\Debug\ExceptionHandler->handle(Object(Error))
#1 {main}
thrown
When we revert it back to PHP5.6 it works. Based on my research this was supposed to be fixed in Symfony > 2.6 is this correct? If so why is this happening on our environment. Most of our Laravel projects are already using PHP7. This, however is an exception, is there something that I am missing?

Laravel and Lumen ACL with Shared Codebase

I have two separate projects:
Admin (Laravel 5.4)
API (Lumen 5.4)
with Shared Codebase (database, models...)
In my Admin project I use spatie/laravel-permission, but this package is not available for Lumen i.e. When I try to install package in my Lumen project (API) I got this error:
Fatal error: Uncaught ReflectionException: Class path.storage does not exist in /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php:681 Stack trace: #0 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(681): ReflectionClass->__construct('path.storage') #1 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(565): Illuminate\Container\Container->build('path.storage') #2 /var/www/html/vendor/laravel/lumen-framework/src/Application.php(208): Illuminate\Container\Container->make('path.storage') #3 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(105): Laravel\Lumen\Application->make('path.storage') #4 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(800): app('path.storage') #5 /var/www/html/vendor/laravel/lumen-framework/config/view.php(31): storage_path('framework/views') #6 /var/www/html/vendor/laravel/lumen-framework/src/Application.php(575): require('/var/www/html/v...') #7 /var/www/html/ in /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 681
Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalErrorException: Uncaught ReflectionException: Class path.storage does not exist in /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php:681 Stack trace: #0 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(681): ReflectionClass->__construct('path.storage') #1 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(565): Illuminate\Container\Container->build('path.storage') #2 /var/www/html/vendor/laravel/lumen-framework/src/Application.php(208): Illuminate\Container\Container->make('path.storage') #3 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(105): Laravel\Lumen\Application->make('path.storage') #4 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(800): app('path.storage') #5 /var/www/html/vendor/laravel/lumen-framework/config/view.php(31): storage_path('framework/views') #6 /var/www/html/vendor/laravel/lumen-framework/src/Appli in /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 681
Where is the problem? Can I use this package in Lumen?
Or could you suggest me some other package for Role & Permission work in Laravel and Lumen.
I saw that spatie/laravel-permission repository does not support Lumen
try to see if this may be for you
http://www.laraveldoctrine.org/docs/1.2/acl

Doctrin 2 and Zendframework 2 after update

Today, using composer, i was updated my application.
My application use zfcUser / BjyAuthorize / Doctrine 2 modules.
And now, after updating, i catch this error:
PHP Fatal error: Uncaught exception 'Zend\\ServiceManager\\Exception\\ServiceNotFoundException' with message 'Zend\\ServiceManager\\ServiceManager::get was unable to fetch or create an instance for doctrine.entity_manager.orm_default' in /var/www/zf/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php:518\nStack trace:\n#0 /var/www/zf/vendor/bjyoungblood/bjy-authorize/src/BjyAuthorize/Service/ObjectRepositoryRoleProviderFactory.php(50): Zend\\ServiceManager\\ServiceManager->get('doctrine.entity...')\n#1 [internal function]: BjyAuthorize\\Service\\ObjectRepositoryRoleProviderFactory->createService(Object(Zend\\ServiceManager\\ServiceManager), 'bjyauthorizepro...', 'BjyAuthorize\\Pr...')\n#2 /var/www/zf/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php(897): call_user_func(Array, Object(Zend\\ServiceManager\\ServiceManager), 'bjyauthorizepro...', 'BjyAuthorize\\Pr...')\n#3 /var/www/zf/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php(1027): Zend\\ServiceMan in /var/www/zf/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 518
Сode was not changed.
Plz, help =)
Try changing the following line in your bjyauthorize configuration:
'object_manager' => 'doctrine.entity_manager.orm_default'to
'object_manager' => 'doctrine.entitymanager.orm_default'

Categories