In my application, I am using google firebase real-time database with admin-sdk for Java. When I run a sample program from my machine it works perfectly and updates the given data into firebase db. But, when I try to run the same program from another public server, it's not working. It doesn't throw any exceptions at all. updateChildren() was executed, and then nothing. I tried with onCompletionListener too.There is nothing in there. What might be the problem?
FBManager.java
import com.nexge.firebase.Firebase;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.ValueEventListener;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import java.util.HashMap;
class FBManager {
//FIREBASE
public static Firebase fireBase;
public static DatabaseReference dbRef = null;
public static String filePath="key/siva-6d0aa-firebase-adminsdk-1bo0t-e98c5af5d5.json";
public static String databaseUrl="https://siva-6d0aa.firebaseio.com";
public static String projectName="ABES";
public static String databaseChildPath;
public static void main(String[] args) {
try {
databaseChildPath="calls/";
System.out.println("Inside iniDB !");
fireBase = new Firebase(filePath, databaseUrl, projectName, databaseChildPath);
System.out.println("FireBase db created!");
dbRef = fireBase.getDatabaseReference();
System.out.println("Got reference!");
T t = new T();
new Thread(t).start();
}
catch(Exception e) {
e.printStackTrace();
}
}
}
T.java
class T implements Runnable {
public void run() {
try {
String path = "191963944/5e0e44e2-3442-4acd-977a-fea7232c0f0a";
HashMap hm1 = new HashMap();
hm1.put("caller_Recv_Media_IpPort","xxx.xxx.xx.xxx:9811");
HashMap hm2 = new HashMap();
hm2.put("yServer_src_Media_IpPort","xxx.xx.xx.xx:10000");
FBManager.dbRef.child(path).updateChildren(hm1);
FBManager.dbRef.child(path).updateChildren(hm2);
Thread.sleep(10000);
}
catch(Exception e) {
e.printStackTrace();
}
}
}