title: Why i am getting 'Entity Not Found' error in symfony
body: <p>I am writing web services, which is working fine on the localhost, but when uploaded on the server i am getting this error:</p>
  
  <blockquote>
    <p>{
      "code": 500,
      "message": "Entity was not found."
    }</p>
  </blockquote>
  
  <p>All entities are there, but still i am getting this error
  This is my controller function:</p>
  
  <pre><code>public function getSendEmailBusinessAction($bussId, $userId)
  {
  
      $em = $this-&gt;getDoctrine()-&gt;getManager();
  
      $query1 = $em-&gt;createQuery('SELECT list.email from StreetBumbApiBundle:BussOwner list WHERE list.id = :bussId')
          -&gt;setParameter("bussId", $bussId);
      $list2 = $query1-&gt;getResult();
      $email = $list2[0]['email'];
  
      $query = $em-&gt;createQuery('SELECT list from StreetBumbApiBundle:UserOffers list WHERE list.userId = :userId')
          -&gt;setParameter("userId", $userId);
      $list = $query-&gt;getResult();
  
     $userEmail =  $list[0]-&gt;getUserId()-&gt;getUsername();
     $offerDescription = $list[0]-&gt;getOfferId()-&gt;getDescription();
     $offerDate = $list[0]-&gt;getOfferId()-&gt;getExpiryDate();
     $offerPhno = $list[0]-&gt;getOfferId()-&gt;getPhno();
  
      $message = \Swift_Message::newInstance()
          -&gt;setSubject('User and offer details selected by user')
          -&gt;setFrom('admin@mail.com')
          -&gt;setTo($email)
          -&gt;setBody(
              "User Email Id: $userEmail",
              "Offer Description:  $offerDescription",
              "Offer Date and Time:  $offerDate",
              "Phone number:  $offerPhno"
          )
  
      ;
      $this-&gt;get('mailer')-&gt;send($message);
  
      if ($list == 0) {
          $view = View::create();
          $response[]=array("code"=&gt;200,"message"=&gt;"Data Not Found","data"=&gt;"");
          $view-&gt;setData($response)-&gt;setStatusCode(200);
          return $view;
      }
      $response[]=array("code"=&gt;200,"message"=&gt;"Success","data"=&gt;$list);
      $view = View::create();
      $view-&gt;setData($response)-&gt;setStatusCode(200);
      return $view;
  
  }
  </code></pre>
  
  <p>Can anyone tell me where is problem?</p>