title: zf2 - Unable to resolve service Zend\Db\Adapter\Adapter to a factory
body: <p>Why i'm getting this error even i have added all the classes already? </p>
  
  <blockquote>
    <p>Unable to resolve service "Zend\Db\Adapter\Adapter" to a factory; are
    you certain you provided it during configuration?</p>
  </blockquote>
  
  <p>Here is my Module.php:</p>
  
  <pre><code>namespace Album;
  
  use Album\Model\Album; 
  use Album\Model\AlbumTable; 
  use Zend\Db\ResultSet\ResultSet; 
  use Zend\Db\TableGateway\TableGateway;
  
  class Module {
  
  
      public function getAutoloaderConfig()
      { 
          return array(
              'Zend\Loader\ClassMapAutoloader' =&gt; array(
                  __DIR__ . '/autoload_classmap.php',
              ),
              'Zend\Loader\StandardAutoloader' =&gt; array(
                  'namespaces' =&gt; array(
                      __NAMESPACE__ =&gt; __DIR__ . '/src/' . __NAMESPACE__,
                  ),
              ),
          );
      }
  
      public function getServiceConfig()
      { 
         return array(
               'factories' =&gt; array(
                   'Album\Model\AlbumTable' =&gt;  function($sm) {
                       $tableGateway = $sm-&gt;get('AlbumTableGateway');
                       $table = new AlbumTable($tableGateway);
                       return $table;
                   },
                   'AlbumTableGateway' =&gt; function ($sm) {
                       $dbAdapter = $sm-&gt;get('Zend\Db\Adapter\Adapter');
                       $resultSetPrototype = new ResultSet();
                       $resultSetPrototype-&gt;setArrayObjectPrototype(new Album());
                       return new TableGateway('album', $dbAdapter, null, $resultSetPrototype);
                   },
               ),
           );
      }   
  
      public function getConfig()
      { 
          return include __DIR__ . '/config/module.config.php';
      } 
  }
  </code></pre>
  
  <p><strong>UPDATED:</strong>
  FILES - application.config.php:</p>
  
  <pre><code>return [
      // Retrieve list of modules used in this application.
      'modules' =&gt; [
          'Zend\Router',
          'Zend\Validator',
          'Application',
          'Album',
          'Blog',
      ],
  
      // These are various options for the listeners attached to the ModuleManager
      'module_listener_options' =&gt; [
          'module_paths' =&gt; [
              './module',
              './vendor',
          ],
          'config_glob_paths' =&gt; [
              // realpath(__DIR__) . '/autoload/{{,*.}global,{,*.}local}.php',
              realpath(__DIR__) . '/autoload/{,*.}{global,local}.php',
          ],
  
  
          'config_cache_enabled' =&gt; false,
  
          // The key used to create the configuration cache file name.
          'config_cache_key' =&gt; 'application.config.cache',
  
  
          'module_map_cache_enabled' =&gt; false,
  
          // The key used to create the class map cache file name.
          'module_map_cache_key' =&gt; 'application.module.cache',
  
          // The path in which to cache merged configuration.
          'cache_dir' =&gt; 'data/cache/',
  
  
          // 'check_dependencies' =&gt; true,
      ],
  
  ];
  </code></pre>