【问题标题】:Class Not Found Exception but it is in the same package类未找到异常,但它在同一个包中
【发布时间】:2018-09-28 03:15:35
【问题描述】:

所以我有一个名为 DataGrabber 的类,它使用 Java Wrapper for Firebase 从我的 Firebase 数据库中获取数据。我包含了依赖项,所有的 java 类都在同一个包中,所以它们都应该可以相互访问。

但是,在哪里抛出了 ClassNotFoundException 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

【问题讨论】:

  • 读取错误,表示找不到HttpRequestBase
  • @ScaryWombat 很抱歉我完全误读了错误
  • 请注意,您使用Firebase 似乎表明您使用的是真正旧版本的 Firebase SDK。我强烈建议您升级到更新的版本:firebase.google.com/docs/database/admin/start

标签: java firebase servlets firebase-realtime-database classnotfoundexception


【解决方案1】:

我找到了上述错误的解决方案,对于依赖项,仅仅在你的库中引用它们是不够的,但你需要将它们导入到你的 WEB-INF/lib 中!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-01-19
    • 1970-01-01
    • 1970-01-01
    • 2023-03-30
    • 2013-04-09
    • 2016-09-13
    相关资源
    最近更新 更多