Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

Problem with plugin manager #302

Open
markdrake opened this issue Jul 13, 2015 · 1 comment
Open

Problem with plugin manager #302

markdrake opened this issue Jul 13, 2015 · 1 comment

Comments

@markdrake
Copy link

Hey guys, I was using successfully the plugin for over a year but after my upgrade to ZF2 version 2.5 I'm getting the following error and I have no idea why this is happening, hope you can give me a hand to understand the problem:

Service "ZfcRbac\Guard\RouteGuard" has been requested to plugin manager of type "ZfcRbac\Guard\GuardPluginManager", but couldn't be retrieved.
A previous exception of type "Zend\ServiceManager\Exception\ServiceNotCreatedException" has been raised in the process.
By the way, a service with the name "ZfcRbac\Guard\RouteGuard" has been found in the parent service locator "Zend\ServiceManager\ServiceManager": did you forget to use $parentLocator = $serviceLocator->getServiceLocator() in your factory code?

This is my stack trace:

0 /var/lib/jenkins/jobs/site/workspace/vendor/zendframework/zend-servicemanager/src/AbstractPluginManager.php(312): Zend\ServiceManager\Exception\ServiceLocatorUsageException::fromInvalidPluginManagerRequestedServiceName(Object(ZfcRbac\Guard\GuardPluginManager), Object(Zend\ServiceManager\ServiceManager), 'ZfcRbac\Guard\R...', Object(Zend\ServiceManager\Exception\ServiceNotCreatedException))

1 /var/lib/jenkins/jobs/site/workspace/vendor/zendframework/zend-servicemanager/src/AbstractPluginManager.php(120): Zend\ServiceManager\AbstractPluginManager->tryThrowingServiceLocatorUsageException('ZfcRbac\Guard\R...', false, Object(Zend\ServiceManager\Exception\ServiceNotCreatedException))

2 /var/lib/jenkins/jobs/site/workspace/vendor/zf-commons/zfc-rbac/src/ZfcRbac/Factory/GuardsFactory.php(51): Zend\ServiceManager\AbstractPluginManager->get('ZfcRbac\Guard\R...', Array)

3 [internal function]: ZfcRbac\Factory\GuardsFactory->createService(Object(Zend\ServiceManager\ServiceManager), 'zfcrbacguards', 'ZfcRbac\Guards')

4 /var/lib/jenkins/jobs/site/workspace/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(939): call_user_func(Array, Object(Zend\ServiceManager\ServiceManager), 'zfcrbacguards', 'ZfcRbac\Guards')

5 /var/lib/jenkins/jobs/site/workspace/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(1097): Zend\ServiceManager\ServiceManager->createServiceViaCallback(Array, 'zfcrbacguards', 'ZfcRbac\Guards')

6 /var/lib/jenkins/jobs/site/workspace/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(638): Zend\ServiceManager\ServiceManager->createFromFactory('zfcrbacguards', 'ZfcRbac\Guards')

7 /var/lib/jenkins/jobs/site/workspace/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(598): Zend\ServiceManager\ServiceManager->doCreate('ZfcRbac\Guards', 'zfcrbacguards')

8 /var/lib/jenkins/jobs/site/workspace/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(530): Zend\ServiceManager\ServiceManager->create(Array)

9 /var/lib/jenkins/jobs/site/workspace/vendor/zf-commons/zfc-rbac/src/ZfcRbac/Module.php(44): Zend\ServiceManager\ServiceManager->get('ZfcRbac\Guards')

10 [internal function]: ZfcRbac\Module->onBootstrap(Object(Zend\Mvc\MvcEvent))

11 /var/lib/jenkins/jobs/site/workspace/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))

12 /var/lib/jenkins/jobs/site/workspace/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('bootstrap', Object(Zend\Mvc\MvcEvent), Array)

13 /var/lib/jenkins/jobs/site/workspace/vendor/zendframework/zend-mvc/src/Application.php(157): Zend\EventManager\EventManager->trigger('bootstrap', Object(Zend\Mvc\MvcEvent))

14 /var/lib/jenkins/jobs/site/workspace/vendor/zendframework/zend-mvc/src/Application.php(261): Zend\Mvc\Application->bootstrap(Array)

15 /var/lib/jenkins/jobs/site/workspace/httpdocs/index.php(33): Zend\Mvc\Application::init(Array)

16 {main}

I'm loading all the classes through composer autoloader. If I disable the module in config/application.config.php I get the site to work correctly.

Thanks in advance.

@danizord
Copy link
Member

danizord commented Sep 9, 2015

Hello @markdrake!

This is probably because of wrong guards config, can you paste your guards config here?

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

No branches or pull requests

2 participants