在 Weka 中导入包时出现 NullPointerException

问题描述 投票:0回答:0

我正在用 Java 为 Weka 开发一个插件,我正在使用 weka/packages/templates 来编译和创建带有

ant
的包。看起来 Weka 在从 GUI(工具>PacketManager>文件/URL)导入包时使用 weka.core.packageManagement.DefaultPackage 类,因为当我尝试在 Weka 3.8.6 中为 Ubuntu 导入生成的 zip 文件时,我得到具有以下堆栈跟踪的 NullPointerException:

java.lang.NullPointerException: Cannot invoke "Object.toString()" because the return value of "weka.core.packageManagement.DefaultPackage.getPackageMetaDataElement(Object)" is null
    at weka.core.packageManagement.DefaultPackage.getDependencies(DefaultPackage.java:252)
    at weka.core.WekaPackageLibIsolatingClassLoader.init(WekaPackageLibIsolatingClassLoader.java:147)
    at weka.core.WekaPackageLibIsolatingClassLoader.<init>(WekaPackageLibIsolatingClassLoader.java:126)
    at weka.core.WekaPackageClassLoaderManager.addPackageToClassLoader(WekaPackageClassLoaderManager.java:369)
    at weka.core.WekaPackageManager.initializeAndLoadUnofficialPackage(WekaPackageManager.java:2372)
    at weka.core.WekaPackageManager.installPackageFromArchive(WekaPackageManager.java:2359)
    at weka.gui.PackageManager$UnofficialInstallTask.doInBackground(PackageManager.java:780)
    at weka.gui.PackageManager$UnofficialInstallTask.doInBackground(PackageManager.java:724)
    at java.desktop/javax.swing.SwingWorker$1.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
    at java.desktop/javax.swing.SwingWorker.run(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)

我在 Ubuntu 上使用 OpenJDK 11.0.18。有人可以帮助我了解导致此错误的原因以及解决方法吗?

提前感谢您的帮助!

java plugins nullpointerexception weka package-management
© www.soinside.com 2019 - 2024. All rights reserved.