title: java.lang.classcastexception: java.lang.long cannot be cast to java.lang.integer
body: <p>i had a exception that is very familiar, but i faced with this exception anormally. </p>
  
  <p>My application was running well in <strong>glassfish 3.1</strong> server, then i migrated my application to <strong>glassfish 3.1.2</strong>. server. I deployed this successfully to new server.</p>
  
  <p>When i opened my application, i got an exception that java.lang.classcastexception: java.lang.long cannot be cast to java.lang.integer. </p>
  
  <p>Firstly, i thought that the exception appears due to <strong>ojdbc6.jar</strong> then i changed this with <strong>ojdbc14.jar</strong>. I restarted the server, but nothing changed. I get the same error. Now, i dont know what i have to do.</p>
  
  <p>The code is:</p>
  
  <pre><code>geriDonecek.setToplamListeBuyuklugu((Integer)criteria2.setProjection(Projections‌​.rowCount()).uniqueResult());
  </code></pre>
  
  <p>Pls help me, I will be very glad. </p>
  
  <p>Thanks in advance.</p>