ZendFramework 2 ZfcRbac模块无法实例化ZfcRbac \ Guard \ RouteGuard

时间:2015-07-13 20:32:51

标签: php zend-framework2 zfc-rbac

我成功使用ZfcRbac模块超过一年但在升级​​到ZF2版本2.5之后我收到以下错误,我不知道为什么会发生这种情况,希望你能帮我理解这个问题:

  

已请求服务“ZfcRbac \ Guard \ RouteGuard”插件   “ZfcRbac \ Guard \ GuardPluginManager”类型的管理器,但不可能   检索。先前的类型异常   “Zend \ ServiceManager \ Exception \ ServiceNotCreatedException”已经存在   在此过程中提出。顺便说一句,一个名称的服务   在父服务中找到了“ZfcRbac \ Guard \ RouteGuard”   定位器“Zend \ ServiceManager \ ServiceManager”:你忘了使用了   您工厂中的$ parentLocator = $ serviceLocator-> getServiceLocator()   码?

这是我的堆栈跟踪:

#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}

我正在通过composer autoloader加载所有类。如果我在config / application.config.php中禁用该模块,我会让网站正常工作。

提前致谢。

0 个答案:

没有答案