新的FirebaseOptions.Build()引发SecurityException

时间:2019-05-10 15:29:36

标签: java firebase firebase-realtime-database glassfish firebase-admin

我尝试将Firebase与Glassfish一起使用,但是当我尝试创建new Firebae.Build()时会抛出SecurityException:

Caused by: java.lang.SecurityException: class "org.slf4j.Logger"'s signer information does not match signer information of other classes in the same package
    at java.lang.ClassLoader.checkCerts(ClassLoader.java:898)
    at java.lang.ClassLoader.preDefineClass(ClassLoader.java:668)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:761)
    at com.sun.enterprise.loader.ASURLClassLoader.findClass(ASURLClassLoader.java:801)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at com.google.firebase.internal.FirebaseThreadManagers.<clinit>(FirebaseThreadManagers.java:34)
    ... 33 more 

基本上:

java.lang.ExceptionInInitializerError
    at com.google.firebase.FirebaseOptions$Builder.<init>(FirebaseOptions.java:235)

但是我在代码中没有看到任何问题,它与Google网络中的代码基本相同:

FirebaseOptions options = new FirebaseOptions.Builder()
                        .setCredentials(GoogleCredentials.fromStream(new FileInputStream("xxxxxx.json")))
                        .setDatabaseUrl("https://xxxxxx.firebaseio.com/")
                        .build();

FirebaseApp.initializeApp(options);

我必须手动安装每个.jar,这是它们的列表(我读过它可能是兼容性错误,但没有找到任何错误)。

  • firebase-admin-6.8.1.jar
  • google-api-client-1.25.0.jar
  • google-auth-library-credentials-0.15.0.jar
  • google-auth-library-oauth2-http-0.15.0.jar
  • google-cloud-storage-1.73.0.jar
  • google-http-client-1.20.0.jar
  • google-http-client-gson-1.20.0.jar
  • google-http-client-jackson2-1.27.0.jar
  • google-oauth-client-1.25.0.jar
  • gson-2.1.jar
  • guava-27.1-jre.jar
  • json.jar
  • logback-classic-0.9.jar
  • logback-core-0.9.6.jar
  • slf4j.jar

谢谢!

0 个答案:

没有答案