如何解决致命错误:在ZF2 Apigility中找不到资源的未捕获异常?

时间:2015-11-10 15:27:21

标签: php zend-framework2 acl apigility

Fatal error: Uncaught exception 'Zend\Permissions\Acl\Exception\InvalidArgumentException' with message 'Resource 'welcome' not found' in /home/prateek.parekh/catalystapi/vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Acl.php on line 292
 Zend\Permissions\Acl\Exception\InvalidArgumentException: Resource 'welcome' not found in /home/prateek.parekh/catalystapi/vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Acl.php on line 292
 Call Stack: 0.0001 627128
 1. {main}() /home/prateek.parekh/catalystapi/public/index.php:0 0.0257 720168 
 2. Zend\Mvc\Application::init() /home/prateek.parekh/catalystapi/public/index.php:56 1.2016 3360648
 3. Zend\Mvc\Application->bootstrap() /home/prateek.parekh/catalystapi/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php:260 1.3708 3632792
 4. Zend\EventManager\EventManager->trigger() /home/prateek.parekh/catalystapi/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php:156 1.3710 3633136
 5. Zend\EventManager\EventManager->triggerListeners() /home/prateek.parekh/catalystapi/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:207 1.5567 3955048
 6. call_user_func:{/home/prateek.parekh/catalystapi/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:468}() /home/prateek.parekh/catalystapi/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:468 1.5568 3955080
 7. Application\Module->onBootstrap() /home/prateek.parekh/catalystapi/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:468 1.7301 4243984
 8. Catalyst\Permissions\Plugin\AclPlugin->doAuthorization() /home/prateek.parekh/catalystapi/module/Application/Module.php:29 1.7531 4246600
 9. Zend\Permissions\Acl\Acl->isAllowed() /home/prateek.parekh/catalystapi/vendor/catalyst/Catalyst/Permissions/Plugin/AclPlugin.php:48 1.7534 4246696
 10. Zend\Permissions\Acl\Acl->getResource() /home/prateek.parekh/catalystapi/vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Acl.php:731 

有人可以指导我解决这个问题的逻辑步骤是什么?我尝试在doAuthorization($e)中停用Application/Module.php

1 个答案:

答案 0 :(得分:0)

添加

'ZF\\Apigility\\Welcome'

到application.config.php' modules'数组将解决此问题

'ZF\Apigility\Welcome'

出现在development.config.php