我试图在Apache Felix上运行一个基于EMF的小型应用程序。 Felix正在Android设备上运行。我使用Eclipse,但没有bnd和没有maven。OSGi - Activator无法访问Bundle的内部软件包
我得到了一个EMF捆绑出口包:
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之外,您使用的春分或菲利克斯? –
内部软件包的导入只是为了使其工作。在此之前,我有一个没有内部软件包和没有出口的版本。 我不知道是否使用EMF反射,但我是这么认为的。春分,但现在我又变回了费利克斯。谢谢 ! –