title: Symfony2 "FatalErrorException: Compile Error: Cannot redeclare class" from time to time
body: <p>today I got an very odd situation. I am implementing a simple 1:m relation between two entites in Doctrine Symfony2.</p>
  
  <p>There are Users and Groups. Each User should be added to exactly one Group.</p>
  
  <p>But every 3-4 reload my controller spits out an error.</p>
  
  <pre><code>FatalErrorException: Compile Error: Cannot redeclare class Proxies\__CG__\Creativebrains\AthleteBundle\Entity\Group in /var/www/symfony2/app/cache/dev/doctrine/orm/Proxies/__CG__CreativebrainsAthleteBundleEntityGroup.php line 8
  </code></pre>
  
  <p>And a reload later I get the normal JSON output</p>
  
  <pre><code>{
      id: 1,
      username: "dominik",
      email: "dominik@creativebrains.net",
      enabled: true,
      displayname: "Dominik",
      group: {
          name: "asd"
          ...
      }
  }
  </code></pre>
  
  <p>I think it is some sort of caching error but I cannot understand why.</p>
  
  <p>Hopefully some one knows an answer.
  Have a nice day!</p>