Issues

ZF-12520: Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for Zend\Db\Adapter\Adapter

Description

The ZF2 skeleton application, using Zf2.1.1 is throwing the following exception after deploying to the ibmi. I have confirmed that mysql and php are working properly by issuing simple mysql_connect and mysql_query calls using the same db credentials being used in the ZF2 app. I also create a simple php script using PDO and that is working properly as well.

Specifics of zend server and PHP on our ibmi PHP version 5.3.14 MySQL: 5.1.50 PHP PDO drivers installed: sqlite, ibm, mysql, pgsql, sqlite2 PDO ibmi support: enabled v1.3.2 PDO Driver for MySQL: v5.0.45

File:

/home/roliv/wwwzend/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php:456

Message:

Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for Zend\Db\Adapter\Adapter

Stack trace:

#0 /home/roliv/wwwzend/zf2-tutorial/module/Album/Module.php(41): Zend\ServiceManager\ServiceManager->get('Zend\Db\Adapter...')
#1 [internal function]: Album\{closure}(Object(Zend\ServiceManager\ServiceManager), 'albumtablegatew...', 'AlbumTableGatew...')
#2 /home/roliv/wwwzend/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php(737): call_user_func(Object(Closure), Object(Zend\ServiceManager\ServiceManager), 'albumtablegatew...', 'AlbumTableGatew...')
#3 /home/roliv/wwwzend/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php(869): Zend\ServiceManager\ServiceManager->createServiceViaCallback(Object(Closure), 'albumtablegatew...', 'AlbumTableGatew...')
#4 /home/roliv/wwwzend/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php(494): Zend\ServiceManager\ServiceManager->createFromFactory('albumtablegatew...', 'AlbumTableGatew...')
#5 /home/roliv/wwwzend/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php(441): Zend\ServiceManager\ServiceManager->create(Array)
#6 /home/roliv/wwwzend/zf2-tutorial/module/Album/Module.php(36): Zend\ServiceManager\ServiceManager->get('AlbumTableGatew...')
#7 [internal function]: Album\{closure}(Object(Zend\ServiceManager\ServiceManager), 'albummodelalbum...', 'Album\Model\Alb...')
#8 /home/roliv/wwwzend/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php(737): call_user_func(Object(Closure), Object(Zend\ServiceManager\ServiceManager), 'albummodelalbum...', 'Album\Model\Alb...')
#9 /home/roliv/wwwzend/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php(869): Zend\ServiceManager\ServiceManager->createServiceViaCallback(Object(Closure), 'albummodelalbum...', 'Album\Model\Alb...')
#10 /home/roliv/wwwzend/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php(494): Zend\ServiceManager\ServiceManager->createFromFactory('albummodelalbum...', 'Album\Model\Alb...')
#11 /home/roliv/wwwzend/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php(441): Zend\ServiceManager\ServiceManager->create(Array)
#12 /home/roliv/wwwzend/zf2-tutorial/module/Album/src/Album/Controller/AlbumController.php(34): Zend\ServiceManager\ServiceManager->get('Album\Model\Alb...')
#13 /home/roliv/wwwzend/zf2-tutorial/module/Album/src/Album/Controller/AlbumController.php(14): Album\Controller\AlbumController->getAlbumTable()
#14 /home/roliv/wwwzend/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractActionController.php(83): Album\Controller\AlbumController->indexAction()
#15 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#16 /home/roliv/wwwzend/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(460): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#17 /home/roliv/wwwzend/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(204): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#18 /home/roliv/wwwzend/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractController.php(117): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#19 /home/roliv/wwwzend/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/Mvc/DispatchListener.php(114): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#20 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#21 /home/roliv/wwwzend/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(460): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#22 /home/roliv/wwwzend/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(204): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#23 /home/roliv/wwwzend/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php(295): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#24 /home/roliv/wwwzend/zf2-tutorial/public/index.php(12): Zend\Mvc\Application->run()
#25 {main}

Comments

Please report all issues for ZF2 on Github.

Thanks!