我尝试将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,这是它们的列表(我读过它可能是兼容性错误,但没有找到任何错误)。
谢谢!