java - FirebaseException: Failed to parse node with class in NodeUtilities.NodeFromJSON -


i'm using firebase in java. following simple code has worked fine when users' information had updated:

final firebasebean_user userobject = new firebasebean_user(uuid, name, timestamp, points, gamesplayed, gameswon); mfirebaseuser.setvalue(userobject, system.currenttimemillis()); 

i used current timestamp priority value can list of users have been online recently.

however, when users go offline, mark them offline. thus, added 1 simple line again in middle:

final firebasebean_user userobject = new firebasebean_user(uuid, name, timestamp, points, gamesplayed, gameswon); mfirebaseuser.ondisconnect().setvalue(userobject, user_priority_offline); // best practice: call ondisconnect() before actual setvalue() operation prevent ghost data mfirebaseuser.setvalue(userobject, system.currenttimemillis()); 

and piece of code stopped working. i'm getting following exception, causing line (465) new 1 in middle:

fatal exception: main com.firebase.client.firebaseexception: failed parse node class class com.my.package.multiplayerservice$firebasebean_user     @ com.firebase.client.snapshot.nodeutilities.nodefromjson(nodeutilities.java:130)     @ com.firebase.client.ondisconnect.setvalue(ondisconnect.java:81)     @ com.my.package.multiplayerservice.updateuserinformation(multiplayerservice.java:465)     @ com.my.package.multiplayerservice.access$4(multiplayerservice.java:461)     @ com.my.package.multiplayerservice$1.ondatachange(multiplayerservice.java:83)     @ com.firebase.client.core.valuelistenercontainer$1.run(valuelistenercontainer.java:50)     @ android.os.handler.handlecallback(handler.java:605)     @ android.os.handler.dispatchmessage(handler.java:92)     @ android.os.looper.loop(looper.java:137)     @ android.app.activitythread.main(activitythread.java:4514)     @ java.lang.reflect.method.invokenative(native method)     @ java.lang.reflect.method.invoke(method.java:511)     @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:790)     @ com.android.internal.os.zygoteinit.main(zygoteinit.java:557)     @ dalvik.system.nativestart.main(native method) 

why happen? doing wrong? mean, setvalue() worked fine before, change call on ondisconnect() , stops working.

(it not matter if there has been data @ reference point before or not.)

here class used reference:

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 && ((firebasebean_user) o).getuuid() == this.uuid);     }  } 

this in fact bug in firebase sdk, sorry that! specifically, it's issue in ondisconnect handler. that's why works ref.setvalue, not ref.ondisconnect().setvalue. i'll fix asap , update answer once it's available.

edit: try grabbing latest sdk https://www.firebase.com/docs/downloads.html should version 1.0.4. let me know if continue have trouble.