Android (Androjena) 上的 Jena 构建失败

发布于 2024-09-25 19:31:33 字数 589 浏览 5 评论 0原文

我目前正在开发一个使用 OWL 本体的移动应用程序。

我计划使用 androjena lib,它是 java jena lib 的端口。

http://code.google.com/p/androjena/

按照文档中的说明,我已将 Androjena 附带的 5 个 .jar 文件添加到 Android 项目的构建路径中。

这会导致编译时出现以下错误:

[2010-10-05 11:19:28 - MS Project] 警告:忽略不附带关联 EnclosureMethod 属性的匿名内部类的 InnerClasses 属性。 (此类可能是由损坏的编译器生成的。)

[2010-10-05 11:19:46 - Dex Loader] 无法执行 dex: null

[2010-10-05 11:19: 46 - MS Project] 转换为 Dalvik 格式失败:无法执行 dex:null

有人遇到过类似的问题吗?

谢谢!

I am currently working on a mobile application which uses OWL ontologies.

I am planning on using the androjena lib which is a port of the java jena lib.

http://code.google.com/p/androjena/

As instructed in the documentation, I have added the 5 .jar files included with Androjena to the build path of the Android Project.

This results in the following errors when compiling:

[2010-10-05 11:19:28 - MS Project] warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)

[2010-10-05 11:19:46 - Dex Loader] Unable to execute dex: null

[2010-10-05 11:19:46 - MS Project] Conversion to Dalvik format failed: Unable to execute dex: null

Anyone experienced similar problems?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

沙与沫 2024-10-02 19:31:33

几个月前,我和我的研究团队参与了一个在基于 Android 的移动设备上使用本体的项目。我们首先尝试了 Androjena 项目 (http://code.google.com/p/androjena/) 但它的开发几乎停止了,并且仅支持 Jena 功能的一个子集。因此,我们尝试在 Android 上使用完整的 Apache Jena 项目。虽然该项目没有直接运行,但我们分析了问题,并在 Android 上提供了 Jena 的完整工作副本。

请参阅 http://elite.polito.it/jena-on-android

Jena 框架通过使用名称空间 javax.* 定义一些包(主要是从依赖项继承,特别是 Xerces)。这样的命名空间当前被 Dalvik 交叉编译器解释为属于“核心”java 库,因此交叉编译并不“安全”。结果是,包含此类包的代码不会被交叉编译,除非编译器设置为“核心库”模式,这会导致编译后的代码可能在系统更新后停止工作,并且正如交叉编译器警告的那样, “最终会导致痛苦、痛苦、悲伤和哀叹。”

实际上这些包不是java核心库的一部分,因此简单的重构就可以解决问题。在具体情况下,我们下载了 xerces 的最新源代码,将所有 javax.* 包重构为 javax2.* 并重新打包了库,一切都运行良好。顺便说一句,这使得 Android 上的完整 Jena 框架成为可能,开发人员能够像当前在典型 Java 应用程序中所做的那样只包含所需的模块。

Few months ago me and my research team were involved in a project using ontologies on Android-based mobile devices. We firstly tried the Androjena project (http://code.google.com/p/androjena/) but it's development is almost ceased and it supports only a subset of the Jena features. Therefore we tried to use the full Apache Jena project on Android. While the project is not directly working, we analyzed the issues and we came out with a fully working copy of Jena on Android.

see http://elite.polito.it/jena-on-android

The Jena framework defines some packages (mostly inherited from dependencies, Xerces, in particular) by using the namespace javax.* . Such a namespace is currently interpreted by the Dalvik cross-compiler as belonging to the "core" java library, thus not being "safe" to cross-compile. The result is that the code containing such packages is not cross-compiled unless the compiler is set in "core-library" mode which results in a compiled code that will probably cease working after system updates and that, as the cross-compiler warns, " will ultimately lead to pain, suffering, grief, and lamentation."

Actually the packages are not part of the java core library therefore a simple re-factoring solves the problem. In the specific case, we downloaded the last sources of xerces, refactored all javax.* packages to javax2.* and re-packed the library, and everything worked perfectly. This, by the way, enables the full Jena framework on Android, with the ability for developers to just include the needed modules as it is currently done in typical Java applications.

仅此而已 2024-10-02 19:31:33

即使我遇到了类似的问题。我从外部 JAR 列表中删除了 icu4j.jar,它工作正常。虽然我不确定为什么首先使用这个 JAR。

无论如何,您是否尝试过对移动应用程序和 OWL 使用任何其他推理器?我尝试了 JESS,但似乎在移植方面存在一些问题。

Even I encountered similar problem. I removed icu4j.jar from list of external JARs and it worked fine. Although I am not sure why this JAR is used in first place.

Anyways, have you tried to use any other reasoners for mobile apps and OWLs? I tried JESS but it seems to have some issues with porting.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文