title: Entity was not found
body: <p>I am having troubles with only 1 class in symfony2,
  Every time i try to use the entity in a template it says the entity was not found.
  However everything works perfectly fine on localhost (both dev and prod environment work), but it all stops working when i deploy it on the remote webserver.</p>
  
  <p>I restarted httpd already and tried different methods.</p>
  
  <p>The Entity UserApplication has an association on the Application entity, i am trying to get the name from the application trough the UserApplication in my template file</p>
  
  <p>This is the error message i is throwing,</p>
  
  <blockquote>
    <p>[ERROR]: An exception has been thrown during the rendering of a
    template ("Entity was not found.") in
    "MyBundle:Application:applications_user.html.twig" at line 34. with
    code: 0 (file: mylocation/20131209193528/app/cache/prod/classes.php,
    line: 4485)</p>
  </blockquote>
  
  <p>Snippet: applications_user.html.twig</p>
  
  <pre><code>{% extends 'MaximCMSBundle:Default:index.html.twig' %}
  
  {% block body %}
      &lt;div class="page"&gt;
          &lt;h3 class="page-header"&gt;Applications&lt;/h3&gt;
          &lt;div class="page-content"&gt;
              &lt;ul class="menu menu-clean"&gt;
                  {% for application in applications %}
                      &lt;li&gt;
                          &lt;a href="{{ path('application_view', {'id' : application.id, 'name' : application.application.name}) }}"&gt;&lt;span&gt;{{ application.application.name }}&lt;/span&gt;&lt;/a&gt;
                      &lt;/li&gt;
                  {% else %}
                      &lt;p&gt;There are no open applications at the moment&lt;/p&gt;
                  {% endfor %}
              &lt;/ul&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  {% endblock %}
  </code></pre>
  
  <p>Entity UserApplication</p>
  
  <pre><code>&lt;?php
  
  namespace MyName\Module\ApplicationBundle\Entity;
  
  use Doctrine\ORM\Mapping as ORM;
  
  /**
   * UserApplication
   *
   * @ORM\Table(name="user_application")
   * @ORM\Entity
   */
  class UserApplication {
      /**
       * @var integer $id
       *
       * @ORM\Column(name="id", type="integer", nullable=false)
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="IDENTITY")
       */
      protected $id;
  
      /**
       * @var User
       *
       * @ORM\ManyToOne(targetEntity="MyName\MyBundle\Entity\User")
       */
      protected $user;
  
      /**
       * @var json_array $details
       *
       * @ORM\Column(name="details", type="json_array", nullable=false)
       */
      protected $details;
  
      /**
       * @var \DateTime $date
       *
       * @ORM\Column(name="date", type="datetime", nullable=true)
       */
      protected $date;
  
      /**
       * @var integer $denied
       *
       * @ORM\Column(name="denied", type="integer", nullable=false)
       */
      protected $denied = 0;
  
      /**
       * @var Application
       *
       * @ORM\ManyToOne(targetEntity="Application", inversedBy="userApplications")
       */
      protected $application;
  
      /**
       * @param Application $application
       */
      public function setApplication($application)
      {
          $this-&gt;application = $application;
      }
  
      /**
       * @return Application
       */
      public function getApplication()
      {
          return $this-&gt;application;
      }
  
      /**
       * @param \DateTime $date
       */
      public function setDate($date)
      {
          $this-&gt;date = $date;
      }
  
      /**
       * @return \DateTime
       */
      public function getDate()
      {
          return $this-&gt;date;
      }
  
      /**
       * @param int $denied
       */
      public function setDenied($denied)
      {
          $this-&gt;denied = $denied;
      }
  
      /**
       * @return int
       */
      public function getDenied()
      {
          return $this-&gt;denied;
      }
  
      /**
       * @param int $id
       */
      public function setId($id)
      {
          $this-&gt;id = $id;
      }
  
      /**
       * @return int
       */
      public function getId()
      {
          return $this-&gt;id;
      }
  
      /**
       * @param \MyName\MyBundle\Entity\User $user
       */
      public function setUser($user)
      {
          $this-&gt;user = $user;
      }
  
      /**
       * @return \MyName\MyBundle\Entity\User
       */
      public function getUser()
      {
          return $this-&gt;user;
      }
  
      /**
       * @param \MyName\MyBundle\Entity\json_array $details
       */
      public function setDetails($details)
      {
          $this-&gt;details = $details;
      }
  
      /**
       * @return \MyName\MyBundle\Entity\json_array
       */
      public function getDetails()
      {
          return $this-&gt;details;
      }
  
      public function getApplicationEntityName()
      {
          return "MyNameModuleApplicationBundle:Application";
      }
  
      public function __toString()
      {
          return "";
      }
  
  }
  </code></pre>
  
  <p>Entity Application:</p>
  
  <pre><code>&lt;?php
  
  namespace MyName\Module\ApplicationBundle\Entity;
  
  use Doctrine\Common\Collections\ArrayCollection;
  use Doctrine\ORM\Mapping as ORM;
  /**
   * MyName\Module\ApplicationBundle\Entity\Application
   *
   * @ORM\Table(name="application")
   * @ORM\Entity
   */
  class Application
  {
      const FIELD_NAME = "NAME";
      const FIELD_TYPE = "TYPE";
  
      /**
       * @ORM\Id
       * @ORM\Column(type="integer")
       * @ORM\GeneratedValue(strategy="IDENTITY")
       *
       * @var integer $id
       */
      protected $id;
  
      /**
       * @var Rank
       *
       * @ORM\ManyToOne(targetEntity="\MyName\MyBundle\Entity\Rank")
       * @ORM\JoinColumn(name="rank_id", referencedColumnName="id", nullable=false)
       */
      protected $rank;
  
      /**
       * @var Website
       *
       * @ORM\ManyToOne(targetEntity="\MyName\MyBundle\Entity\Website")
       * @ORM\JoinColumn(name="website_id", referencedColumnName="id", nullable=false)
       */
      protected $website;
  
      /**
       * @var string $name
       *
       * @ORM\Column(name="application_name", type="string", nullable=false)
       */
      protected $name;
  
      /**
       * @var string $enabled
       *
       * @ORM\Column(name="application_enabled", type="integer", nullable=false)
       */
      protected $enabled = 0;
  
      /**
       * @var array $fields
       *
       * @ORM\Column(name="application_fields", type="json_array", nullable=true)
       */
      protected $fields;
  
      /**
       *
       * @ORM\OneToMany(targetEntity="UserApplication", mappedBy="application")
       */
      protected $userApplications;
  
      public function __construct()
      {
          $this-&gt;date = new \DateTime("now");
          $this-&gt;userApplications = new ArrayCollection();
      }
  
      /**
       * @param string $enabled
       */
      public function setEnabled($enabled)
      {
          $this-&gt;enabled = $enabled;
      }
  
      /**
       * @return string
       */
      public function getEnabled()
      {
          return $this-&gt;enabled;
      }
  
      /**
       * @param string $path
       */
      public function setPath($path)
      {
          $this-&gt;path = $path;
      }
  
      /**
       * @return string
       */
      public function getPath()
      {
          return $this-&gt;path;
      }
  
      /**
       * @param int $id
       */
      public function setId($id)
      {
          $this-&gt;id = $id;
      }
  
      /**
       * @return int
       */
      public function getId()
      {
          return $this-&gt;id;
      }
  
      /**
       * @param \MyName\MyBundle\Entity\Rank $rank
       */
      public function setRank($rank)
      {
          $this-&gt;rank = $rank;
      }
  
      /**
       * @return \MyName\MyBundle\Entity\Rank
       */
      public function getRank()
      {
          return $this-&gt;rank;
      }
  
      /**
       * @param \MyName\MyBundle\Entity\Website $website
       */
      public function setWebsite($website)
      {
          $this-&gt;website = $website;
      }
  
      /**
       * @return \MyName\MyBundle\Entity\Website
       */
      public function getWebsite()
      {
          return $this-&gt;website;
      }
  
      /**
       * @param string $name
       */
      public function setName($name)
      {
          $this-&gt;name = $name;
      }
  
      /**
       * @return string
       */
      public function getName()
      {
          return $this-&gt;name;
      }
  
      /**
       * @param array $fields
       */
      public function setFields($fields)
      {
          $this-&gt;fields = $fields;
      }
  
      /**
       * @return array
       */
      public function getFields()
      {
          return $this-&gt;fields;
      }
  
      function __toString()
      {
          return $this-&gt;name;
      }
  
      /**
       * @param mixed $userApplications
       */
      public function setUserApplications($userApplications)
      {
          $this-&gt;userApplications = $userApplications;
      }
  
      /**
       * @return mixed
       */
      public function getUserApplications()
      {
          return $this-&gt;userApplications;
      }
  
  
  }
  </code></pre>