【发布时间】:2012-06-05 18:48:31
【问题描述】:
我正在尝试在 Apache Felix 上运行一个基于 EMF 的小型应用程序。 Felix 在 Android 设备上运行。我正在使用 Eclipse,但没有 bnd 和 maven。
我有一个 EMF Bundle,可以导出以下软件包:
org.eclipse.emf.common_droid-2.7.0.v20120127-1122.jar
org.eclipse.emf.ecore_droid-2.7.0.v20120127-1122.jar
org.eclipse.emf.ecore.xmi_droid-2.7.0.v20120127-1122.jar
我的插件项目的结构:
[+] src
---> com.androidosgi.notifier
---> com.androidosgi.notifier.notification
---> com.androidosgi.notifier.notification.impl
---> com.androidosgi.notifier.notification.util
[+] META-INF
---> MANIFEST.MF
Notification-1.0.ecore
Notification-1.0.ecorediag
Notification-1.0.ecorert
NotificationComponent.xmi
激活器在 com.androidosgi.notifier 中。
MANIFEST.MF:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Notification Testing
Bundle-SymbolicName: com.androidosgi.notifier
Bundle-Version: 12.6.5
Bundle-Activator: com.androidosgi.notifier.Activator
Bundle-Vendor: Homer Simpson
Import-Package:
com.androidosgi.notifier.notification,
com.androidosgi.notifier.notification.impl,
com.androidosgi.notifier.notification.util,
org.eclipse.emf.common,
org.eclipse.emf.common.archive,
org.eclipse.emf.common.command,
org.eclipse.emf.common.notify,
org.eclipse.emf.common.notify.impl,
org.eclipse.emf.common.util,
org.eclipse.emf.ecore,
org.eclipse.emf.ecore.impl,
org.eclipse.emf.ecore.plugin,
org.eclipse.emf.ecore.resource,
org.eclipse.emf.ecore.resource.impl,
org.eclipse.emf.ecore.util,
org.eclipse.emf.ecore.xmi,
org.eclipse.emf.ecore.xmi.impl,
org.eclipse.emf.ecore.xmi.util,
org.eclipse.emf.ecore.xml.namespace,
org.eclipse.emf.ecore.xml.namespace.impl,
org.eclipse.emf.ecore.xml.namespace.util,
org.eclipse.emf.ecore.xml.type,
org.eclipse.emf.ecore.xml.type.impl,
org.eclipse.emf.ecore.xml.type.internal,
org.eclipse.emf.ecore.xml.type.util,
org.osgi.framework;version="1.3.0"
Bundle-ClassPath: .
Export-Package: com.androidosgi.notifier;x-internal:=true,
com.androidosgi.notifier.notification;x-internal:=true,
com.androidosgi.notifier.notification.impl;x-internal:=true,
com.androidosgi.notifier.notification.util;x-internal:=true
在 OSGi 上安装包之前,我将其“dexed”并将 classes.dex 添加到包中。
如果我尝试开始,我会得到:NoClassDefFoundError
有什么想法或解决方案吗? :) 谢谢
【问题讨论】:
-
看看你的清单,为什么你的包导出了这么多它的内部包?你有异常的堆栈跟踪吗? EMF 是否使用反射来加载包的内部类?当你在 Android 之外运行时,你使用的是 Equinox 还是 Felix?
-
内部包的导入只是为了让它发挥作用。在此之前,我有一个没有内部包且没有导出的版本。我不确定是否使用了 EMF 反射,但我认为是的。 Equinox,但现在我又变回了 felix。谢谢!
标签: android eclipse osgi noclassdeffounderror emf