3

After having to switch to the Firebase Admin 4.0.0 SDK, I get this on the server. Anyone know any way that I can switch back to the old server-sdk dependency, or a way to work round this exception? I've reported it to FB in the meantime, but would like to get the server running again... at the moment I seem to be totally stuck.

java.lang.NoClassDefFoundError: com/google/firebase/database/collection/LLRBNode$NodeVisitor
  at com.google.firebase.database.snapshot.PriorityUtilities.NullPriority(PriorityUtilities.java:13)
  at com.google.firebase.database.snapshot.NodeUtilities.NodeFromJSON(NodeUtilities.java:12)
  at com.google.firebase.database.core.Repo.updateInfo(Repo.java:540)
  at com.google.firebase.database.core.Repo.onServerInfoUpdate(Repo.java:494)
  at com.google.firebase.database.core.Repo.onDisconnect(Repo.java:485)
  at com.google.firebase.database.connection.PersistentConnectionImpl.onDisconnect(PersistentConnectionImpl.java:409)
  at com.google.firebase.database.connection.Connection.close(Connection.java:82)
  at com.google.firebase.database.connection.Connection.onReset(Connection.java:199)
  at com.google.firebase.database.connection.Connection.onControlMessage(Connection.java:152)
  at com.google.firebase.database.connection.Connection.onMessage(Connection.java:110)
  at com.google.firebase.database.connection.WebsocketConnection.appendFrame(WebsocketConnection.java:226)
  at com.google.firebase.database.connection.WebsocketConnection.handleIncomingFrame(WebsocketConnection.java:271)
  at com.google.firebase.database.connection.WebsocketConnection.access$500(WebsocketConnection.java:20)
  at com.google.firebase.database.connection.WebsocketConnection$WSClientTubesock$2.run(WebsocketConnection.java:67)
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: com.google.firebase.database.collection.LLRBNode$NodeVisitor
  at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  ... 21 more

and a bit later:

Tue Nov 08 14:49:06 CET 2016 [ERROR] RunLoop: Uncaught exception in Firebase Database runloop (3.0.0). Please report to support@firebase.com
java.lang.NullPointerException
at com.google.firebase.database.core.Repo.addEventCallback(Repo.java:518)
at com.google.firebase.database.Query$3.run(Query.java:195)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
MrBigglesworth
  • 350
  • 1
  • 8

4 Answers4

3

Firebase has just released version 4.0.1 of firebase-admin. This adds the missing classes and appears to work correctly.

This could have been managed better. Version 4.0.0 of firebase-admin should have been tested, and in addition, it does not make sense to kill the old dependency at the same time as adding a new one - there should be some time (at least a few days) where people are not forced to upgrade.

MrBigglesworth
  • 350
  • 1
  • 8
1

Just got it to work myself with this addition in the POM file (You can still use the latest firebase implementation):

<dependency>
  <groupId>com.google.firebase</groupId>
  <artifactId>firebase-server-sdk</artifactId>
  <version>4.0.0</version>
</dependency>
<dependency>
  <groupId>com.google.firebase</groupId>
  <artifactId>firebase-server-sdk</artifactId>
  <version>3.0.1</version>
</dependency>
sim
  • 11
  • 3
  • Thanks, but that is moving back to the pre-Google firebase dependency and is missing key classes like DatabaseReference, so doesn't fix for me. – MrBigglesworth Nov 09 '16 at 08:06
  • Changed the answer, please note that you will not be missing any classes. – sim Nov 09 '16 at 08:38
0

ran into exactly the same problem this morning. Apparently Firebase updated the version of firebase-server-sdk to 3.0.2 which is an empty package, forcing the switch to firebase-admin 4.0.0. You can still use firebase-server-sdk 3.0.1 though. In your maven file put:

<dependency>
  <groupId>com.google.firebase</groupId>
  <artifactId>firebase-server-sdk</artifactId>
  <version>3.0.1</version>
</dependency>

Mine had the equivalent version of

  <version>[3.0.1,)</version>

which makes it pull 3.0.2 instead of 3.0.1 cause it's the newest

Once the issues with firebase-admin are resolved, it's probably a good idea to switch to it

Yuval Sapir
  • 166
  • 1
  • 4
  • Unfortunately something seems to be wrong with the firebase-server-sdk artefact resolution, I can't switch back to firebase-server-sdk, have tried 3.0.1, 3.0.2, it doesn't resolve any more (on three different machines with different setups, am sure it's not a local issue). Are you sure a clean and build works for you? – MrBigglesworth Nov 08 '16 at 18:46
0

I solved the problem, it is necessary to renew the version to 4.0.1!!