title: FirebaseException: Failed to parse node with class in NodeUtilities.NodeFromJSON
body: <p>I'm using Firebase in Java. The following simple code has always worked fine when users' information had to be updated:</p>
  
  <pre><code>final FirebaseBean_User userObject = new FirebaseBean_User(uuid, name, timestamp, points, gamesPlayed, gamesWon);
  mFirebaseUser.setValue(userObject, System.currentTimeMillis());
  </code></pre>
  
  <p>I used the current timestamp as the priority value so that I can get a list of all users that have been online recently.</p>
  
  <p>However, when users go offline, I would like to mark them as offline. Thus, I added one simple line again in the middle:</p>
  
  <pre><code>final FirebaseBean_User userObject = new FirebaseBean_User(uuid, name, timestamp, points, gamesPlayed, gamesWon);
  mFirebaseUser.onDisconnect().setValue(userObject, USER_PRIORITY_OFFLINE); // best practice: always call onDisconnect() before the actual setValue() operation to prevent ghost data
  mFirebaseUser.setValue(userObject, System.currentTimeMillis());
  </code></pre>
  
  <p>And suddenly this piece of code stopped working. I'm getting the following Exception, where the causing line (465) is the new one in the middle:</p>
  
  <pre><code>FATAL EXCEPTION: main
  com.firebase.client.FirebaseException: Failed to parse node with class class com.my.package.MultiplayerService$FirebaseBean_User
      at com.firebase.client.snapshot.NodeUtilities.NodeFromJSON(NodeUtilities.java:130)
      at com.firebase.client.OnDisconnect.setValue(OnDisconnect.java:81)
      at com.my.package.MultiplayerService.updateUserInformation(MultiplayerService.java:465)
      at com.my.package.MultiplayerService.access$4(MultiplayerService.java:461)
      at com.my.package.MultiplayerService$1.onDataChange(MultiplayerService.java:83)
      at com.firebase.client.core.ValueListenerContainer$1.run(ValueListenerContainer.java:50)
      at android.os.Handler.handleCallback(Handler.java:605)
      at android.os.Handler.dispatchMessage(Handler.java:92)
      at android.os.Looper.loop(Looper.java:137)
      at android.app.ActivityThread.main(ActivityThread.java:4514)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:511)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
      at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>Why does that happen? Am I doing anything wrong? I mean, <code>setValue()</code> worked fine before, now the only change is that I call it on <code>onDisconnect()</code> as well and it stops working.</p>
  
  <p>(It does not matter if there has been data at that reference point before or not.)</p>
  
  <p>Here is the class that is used for reference:</p>
  
  <pre><code>private static class FirebaseBean_User {
  
      private String uuid;
      private String name;
      private int lastlogin;
      private double points;
      private int gamesplayed;
      private int gameswon;
  
      private FirebaseBean_User() { }
  
      public FirebaseBean_User(String uuid, String name, int lastlogin, double points, int gamesplayed, int gameswon) {
          this.uuid = uuid;
          this.name = name;
          this.lastlogin = lastlogin;
          this.points = points;
          this.gamesplayed = gamesplayed;
          this.gameswon = gameswon;
      }
  
      public String getUuid() {
          return uuid;
      }
  
      public String getName() {
          return name;
      }
  
      public int getLastlogin() {
          return lastlogin;
      }
  
      public double getPoints() {
          return points;
      }
  
      public int getGamesplayed() {
          return gamesplayed;
      }
  
      public int getGameswon() {
          return gameswon;
      }
  
      @Override
      public boolean equals(Object o) {
          return (o instanceof FirebaseBean_User &amp;&amp; ((FirebaseBean_User) o).getUuid() == this.uuid);
      }
  
  }
  </code></pre>