我試圖在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反射,但我是這麼認爲的。春分,但現在我又變回了費利克斯。謝謝 ! –