title: ZF2 Module (Application) could not be initialized
body: <p>I have application.config.php which is 100% right:</p>
  
  <pre><code>return array(
      'modules' =&gt; array(
          'Application',
      ),
      'module_listener_options' =&gt; array(
          'config_glob_paths'    =&gt; array(
              'config/autoload/{,*.}{local,global}.php',
          ),
          'config_cache_enabled' =&gt; false,
          'cache_dir' =&gt; 'data/cache',
          'module_paths' =&gt; array(
              realpath(__DIR__ . '/../module'),
          ),
      )
  );
  </code></pre>
  
  <p>Then I get this error:</p>
  
  <blockquote>
    <p>Module (Application) could not be initialized.</p>
  </blockquote>
  
  <p>I have followed the error and it seem that ModuleAutoloader isn't loading my files.</p>
  
  <p>The <code>$this-&gt;paths</code> array is right to the module folder. My Module file is in <code>module/Application/Module.php</code></p>
  
  <p>It is a namespaced application and the class is Module. I just can't get what the problem might be.</p>
  
  <pre><code>&lt;?php
  namespace Application;
  
  class Module
  {
      /**
       * Module directory path
       *
       * @var string
       */
      protected $directory = null;
  
      /**
       * Module namespace
       *
       * @var string
       */
      protected $namespace = null;
  
      /**
       * Module configuration
       *
       * @var array
       */
      protected $config;
  
      /**
       * Get autoloader config
       *
       * @return array
       */
      public function getAutoloaderConfig()
      {
          return array(
              'Zend\Loader\ClassMapAutoloader' =&gt; array(
                  $this-&gt;getDir() . '/autoload_classmap.php',
              ),
              'Zend\Loader\StandardAutoloader' =&gt; array(
                  'namespaces' =&gt; array(
                      $this-&gt;getNamespace() =&gt; $this-&gt;getDir() . '/src/' . $this-&gt;getNamespace(),
                  ),
              ),
          );
      }
  
      /**
       * Get module configuration
       *
       * @return array
       */
      public function getConfig()
      {
          if (empty($this-&gt;config)) {
              $config       = include $this-&gt;getDir() . '/config/module.config.php';
              $this-&gt;config = $config;
          }
  
          return $this-&gt;config;
      }
  
      /**
       * Get module dir
       *
       * @return string
       */
      protected function getDir()
      {
          return $this-&gt;directory;
      }
  
      /**
       * get module namespace
       *
       * @return string
       */
      protected function getNamespace()
      {
          return $this-&gt;namespace;
      }
  }
  </code></pre>