title: symfony2: class included in AppKernel can not be found
body: <p>I have this <code>app/AppKernel</code>:</p>
  
  <pre><code>&lt;?php
  
  use Symfony\Component\HttpKernel\Kernel;
  use Symfony\Component\Config\Loader\LoaderInterface;
  
  class AppKernel extends Kernel
  {
      public function registerBundles()
      {
          $bundles = array(
              new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
              new Symfony\Bundle\SecurityBundle\SecurityBundle(),
              new Symfony\Bundle\TwigBundle\TwigBundle(),
              new Symfony\Bundle\MonologBundle\MonologBundle(),
              new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
              new Symfony\Bundle\AsseticBundle\AsseticBundle(),
              new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
              new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
              new JMS\AopBundle\JMSAopBundle(),
              new JMS\DiExtraBundle\JMSDiExtraBundle($this),
              new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
              new JMS\I18nRoutingBundle\JMSI18nRoutingBundle(),
              new FOS\UserBundle\FOSUserBundle(),
              new Sports\FrontendBundle\SportsFrontendBundle(),   // line 25             
              new Sports\UserBundle\SportsUserBundle(),
              new Sonata\DefaultBundle\SonataDefaultBundle(),
              new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
              new Sonata\AdminBundle\SonataAdminBundle(),
              new Sonata\BlockBundle\SonataBlockBundle(),
              new Sonata\CacheBundle\SonataCacheBundle(),
              new Knp\Bundle\MenuBundle\KnpMenuBundle(),
              new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle()
          );
  
          if (in_array($this-&gt;getEnvironment(), array('dev', 'test'))) {
  #$bundles[] = new Acme\DemoBundle\AcmeDemoBundle();
              $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
              $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
              $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
          }
  
          return $bundles;
      }
  
      public function registerContainerConfiguration(LoaderInterface $loader)
      {
          $loader-&gt;load(__DIR__.'/config/config_'.$this-&gt;getEnvironment().'.yml');
      }
  </code></pre>
  
  <p>And this class <code>src/Sports/FrontendBundle/SportsFrontendBundle.php</code>:</p>
  
  <pre><code>namespace Sports\FrontendBundle;
  
  use Symfony\Component\HttpKernel\Bundle\Bundle;
  
  class SportsFrontendBundle extends Bundle
  {
  }
  </code></pre>
  
  <p>And Im getting this error:</p>
  
  <blockquote>
    <p>Fatal error: Class 'Sports\FrontendBundle\SportsFrontendBundle' not
    found in /home/tirengarfio/programacion/sports/app/AppKernel.php on
    line 25</p>
  </blockquote>
  
  <p>This is my <code>app/autoload.php</code>:</p>
  
  <pre><code>&lt;?php
  
  use Doctrine\Common\Annotations\AnnotationRegistry;
  
  if (!$loader = @include __DIR__.'/../vendor/autoload.php') {
  
      $message = &lt;&lt;&lt; EOF
  &lt;p&gt;You must set up the project dependencies by running the following commands:&lt;/p&gt;
  &lt;pre&gt;
      curl -s http://getcomposer.org/installer | php
      php composer.phar install
  &lt;/pre&gt;
  
  EOF;
  
      if (PHP_SAPI === 'cli') {
          $message = strip_tags($message);
      }
  
      die($message);
  }
  
  // intl
  if (!function_exists('intl_get_error_code')) {
      require_once __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
  
      $loader-&gt;add('', __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs');
      $loader-&gt;add('Sports',   __DIR__ . '/../src');
  }
  
  AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
  
  return $loader;
  </code></pre>
  
  <p>and my <code>composer.json</code>:</p>
  
  <pre><code>{
      "name": "symfony/framework-standard-edition",
      "description": "The \"Symfony Standard Edition\" distribution",
      "autoload": {
          "psr-0": { "": "src/" }
      },
      "require": {
          "php": "&gt;=5.3.3",
          "symfony/symfony": "2.1.1",
          "doctrine/orm": "2.2.*",
          "doctrine/doctrine-bundle": "dev-master",
          "twig/extensions": "dev-master",
          "symfony/assetic-bundle": "dev-master",
          "symfony/swiftmailer-bundle": "dev-master",
          "symfony/monolog-bundle": "dev-master",
          "sensio/framework-extra-bundle": "*",
          "sensio/distribution-bundle": "*",
          "sensio/generator-bundle": "*",
          "friendsofsymfony/user-bundle": "*",
          "jms/security-extra-bundle": "1.1.*",
          "jms/di-extra-bundle": "1.0.*",
          "jms/i18n-routing-bundle" : "1.0.*",
          "sonata-project/exporter" : "dev-master",
          "sonata-project/jquery-bundle" : "dev-master",
          "sonata-project/block-bundle" : "dev-master",
          "sonata-project/cache-bundle" : "dev-master",
          "sonata-project/admin-bundle" : "dev-master",
          "sonata-project/user-bundle" : "dev-master",
          "sonata-project/doctrine-orm-admin-bundle" : "dev-master",
          "stof/doctrine-extensions-bundle": "dev-master"
      },
      "scripts": {
          "post-install-cmd": [
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
          ],
          "post-update-cmd": [
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
          ]
      },
      "config": {
          "bin-dir": "bin"
      },
      "minimum-stability": "dev",
      "extra": {
          "symfony-app-dir": "app",
          "symfony-web-dir": "web"
      }
  }
  </code></pre>
  
  <p>Any idea?</p>
  
  <p>sf 2.1.1</p>
  
  <p>Javi</p>