title: play.exceptions.JavaExecutionException: id to load is required for loading
body: <p>I'm getting error at "User.findById(user_id)" not frequently but some times, I don't know why. What causes this error?</p>
  
  <p>Note : I'm using Play version 1.2.3</p>
  
  <p>Thanks.</p>
  
  <p>Function where throws exception;</p>
  
  <pre><code>public static void getMemberProfile(Long user _id){
         User sessionUser = getUser();
          User user = User.findById(user_id);
  </code></pre>
  
  <p>Error message ; </p>
  
  <pre><code>2012-02-12T13:06:42+00:00 app[web.1]: 
  2012-02-12T13:06:42+00:00 app[web.1]: Execution exception (In /app/controllers/UserApi.java around line 470)
  2012-02-12T13:06:42+00:00 app[web.1]: IllegalArgumentException occured : id to load is required for loading
  2012-02-12T13:06:42+00:00 app[web.1]: 
  2012-02-12T13:06:42+00:00 app[web.1]: play.exceptions.JavaExecutionException: id to load is required for loading
  2012-02-12T13:06:42+00:00 app[web.1]:   at play.mvc.ActionInvoker.invoke(ActionInvoker.java:229)
  2012-02-12T13:06:42+00:00 app[web.1]:   at Invocation.HTTP Request(Play!)
  2012-02-12T13:06:42+00:00 app[web.1]: Caused by: java.lang.IllegalArgumentException: id to load is required for loading
  2012-02-12T13:06:42+00:00 app[web.1]:   at org.hibernate.event.LoadEvent.&lt;init&gt;(LoadEvent.java:89)
  2012-02-12T13:06:42+00:00 app[web.1]:   at org.hibernate.event.LoadEvent.&lt;init&gt;(LoadEvent.java:61)
  2012-02-12T13:06:42+00:00 app[web.1]:   at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1002)
  2012-02-12T13:06:42+00:00 app[web.1]:   at org.hibernate.impl.SessionImpl.get(SessionImpl.java:998)
  2012-02-12T13:06:42+00:00 app[web.1]:   at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:614)
  2012-02-12T13:06:42+00:00 app[web.1]:   at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:589)
  2012-02-12T13:06:42+00:00 app[web.1]:   at play.db.jpa.JPQL.findById(JPQL.java:34)
  2012-02-12T13:06:42+00:00 app[web.1]:   at models.User.findById(User.java)
  2012-02-12T13:06:42+00:00 app[web.1]:   at controllers.UserApi.getMemberProfile(UserApi.java:470)
  2012-02-12T13:06:42+00:00 app[web.1]:   at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:546)
  2012-02-12T13:06:42+00:00 app[web.1]:   at play.mvc.ActionInvoker.invoke(ActionInvoker.java:500)
  2012-02-12T13:06:42+00:00 app[web.1]:   at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:476)
  2012-02-12T13:06:42+00:00 app[web.1]:   at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:471)
  2012-02-12T13:06:42+00:00 app[web.1]:   at play.mvc.ActionInvoker.invoke(ActionInvoker.java:159)
  </code></pre>