Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/375.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 未写入Firebase,也未引发任何错误_Java_Firebase_Firebase Realtime Database - Fatal编程技术网

Java 未写入Firebase,也未引发任何错误

Java 未写入Firebase,也未引发任何错误,java,firebase,firebase-realtime-database,Java,Firebase,Firebase Realtime Database,我正在创建一个使用Firebase作为主数据库的web应用程序 对于一些原型,我已经能够根据需要更新并向数据库写入数据,但是在几周前,在我更新SDK之前和之后,它已经停止向数据库添加数据。 这是我调用和写入数据库的代码 DatabaseReference data; public void Send(String jobName, Genome currentGenome, Gene currentGene) throws FileNotFoundException { FileInp

我正在创建一个使用Firebase作为主数据库的web应用程序

对于一些原型,我已经能够根据需要更新并向数据库写入数据,但是在几周前,在我更新SDK之前和之后,它已经停止向数据库添加数据。 这是我调用和写入数据库的代码

DatabaseReference data;

public void Send(String jobName, Genome currentGenome, Gene currentGene) throws FileNotFoundException {
    FileInputStream serviceAccount = new FileInputStream(ResultstoFirebaseCopy.class.getClassLoader()
            .getResource("<Admin Authentication>.json").getPath()
            .replaceAll("%20", " "));

    FirebaseOptions options = new FirebaseOptions.Builder()
            .setCredential(FirebaseCredentials.fromCertificate(serviceAccount))
            .setDatabaseUrl("https://<projectname>.firebaseio.com/").build();

    FirebaseApp.initializeApp(options);

    data=FirebaseDatabase.getInstance().getReference();

    // loop through with results from genome class
    System.out.println(currentGenome.getGenome());

    DatabaseReference cellref = Genespot.child(jobName).child(currentGenome.getKingdom())
            .child(currentGenome.getSubType()).child(currentGenome.getTaxID())
            .child(currentGenome.getGenome().replace('.', 'v')).child(currentGene.getName());

    Hit[] hits = currentGene.getHits();

    cellref.child("Hit Count").setValue(hits.length, new DatabaseReference.CompletionListener() {
        @Override
        public void onComplete(DatabaseError arg0, DatabaseReference arg1) {
            throw arg0.toException();
        }
    });

    int i = 0;

    while (i < hits.length) {
        cellref.child("Hit" + (i + 1)).child("Accession Number").setValue(
                hits[i].getAccesionNumber().replace('.', 'v'), new DatabaseReference.CompletionListener() {
                    @Override
                    public void onComplete(DatabaseError arg0, DatabaseReference arg1) {
                        throw arg0.toException();
                    }
                });
        cellref.child("Hit" + (i + 1)).child("Hit From").setValue(hits[i].getHitFrom(),
                new DatabaseReference.CompletionListener() {
                    @Override
                    public void onComplete(DatabaseError arg0, DatabaseReference arg1) {
                        throw arg0.toException();
                    }
                });
        cellref.child("Hit" + (i + 1)).child("Hit To").setValue(hits[i].getHitTo(),
                new DatabaseReference.CompletionListener() {
                    @Override
                    public void onComplete(DatabaseError arg0, DatabaseReference arg1) {
                        throw arg0.toException();
                    }
                });

        i++;
    }
}
数据库参考数据;
public void Send(字符串jobName、Genome currentGenome、Gene currentGene)引发FileNotFoundException{
FileInputStream serviceAccount=新的FileInputStream(ResultstoFirebaseCopy.class.getClassLoader()
.getResource(“.json”).getPath()
.replaceAll(“%20”和“);
FirebaseOptions=newfirebaseOptions.Builder()
.setCredential(FirebaseCredentials.fromCertificate(serviceAccount))
.setDatabaseUrl(“https://.firebaseio.com/build();
FirebaseApp.initializeApp(选项);
data=FirebaseDatabase.getInstance().getReference();
//循环使用基因组类的结果
System.out.println(currentGenome.getGenome());
DatabaseReference cellref=Genespot.child(jobName).child(currentGenome.getKingdom())
.child(currentGenome.getSubType()).child(currentGenome.getTaxID())
.child(currentGenome.getGenome().replace('.',v')).child(currentGene.getName());
Hit[]hits=currentGene.getHits();
cellref.child(“命中计数”).setValue(hits.length,new DatabaseReference.CompletionListener()){
@凌驾
公共void onComplete(数据库错误arg0,数据库引用arg1){
抛出arg0.toException();
}
});
int i=0;
while(i
读写访问是真实的,没有任何东西会被扔回给我