Search code examples
javafirebaseservletsfirebase-realtime-databaseclassnotfoundexception

Class Not Found Exception but it is in the same package


So I have a class called DataGrabber that uses the Java Wrapper for Firebase to get data from my Firebase DB. I included the dependencies and all the java classes are in the same package so they should all have access to each other.

However, there is a ClassNotFoundException thrown where firebase = new Firebase(String url);

public class DataGrabber {

    Firebase firebase;
    FirebaseResponse response;

    public DataGrabber(String url) {
        try {
            firebase = new Firebase(url);
        } catch (FirebaseException e) {
            e.printStackTrace();
        }
    }
}

Here is the error message


Solution

  • I found the solution to the above error, for dependencies it isn't enough to simply reference them in your library, but you need to import them to your WEB-INF/lib!