I'm bundling felix with a webstart app that downloads other bundles from the
internet.
public static void main(String[] args){
final File cachedir = getCacheDir();
final Map configMap = new StringMap(false);
configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA,
"com.loaderApp.main.packages,com.sun.java.swing.plaf.motif,com.sun.java.swing.plaf.windows,napkin");
configMap.put(FelixConstants.LOG_LEVEL_PROP, "1");
configMap.put(Constants.FRAMEWORK_STORAGE,
cachedir.getAbsolutePath());
final List<BundleActivator> list = new ArrayList<BundleActivator>();
final AutoActivator autoActivator = new AutoActivator(configMap);
list.add(autoActivator);
configMap.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP, list);
Felix felix = new Felix(configMap);
felix.start();
Bundlecontext m_bundleContext =
felix.getBundleContext().getBundle(0).getBundleContext();
//Download bundle files and asign them to url
final Bundle bundle = m_bundleContext.installBundle(url.toString(),
url.openStream());
bundle.start();
}
My main app runs fine.
My first bundle runs too, but only because I'm assingning the main
classloader to the thread
ClassLoader osgiClassloader = Aplicacion.class.getClassLoader();
Thread.currentThread().setContextClassLoader(osgiClassloader);
it also registers a service that is used and ungetted by my second bundle.
The third and fourth bundle produce class not found exceptions
org.osgi.framework.BundleException: Activator start error in bundle
NapkinPluggin [4].
at org.apache.felix.framework.Felix.startBundle(Felix.java:1506)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:779)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:760)
at
com.psiqueware.orquidea.simpodial.manager.OsgiManagerK.habilita(OsgiManagerK.java:336)
at
com.psiqueware.orquidea.simpodial.manager.OsgiManagerK$2.run(OsgiManagerK.java:289)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NoClassDefFoundError: napkin/NapkinLookAndFeel
It doesnt really matter the order bundle A or B always one fails and the
bundle C(napkin) fails in every combination I have tried.
thank you for your help.
Angel
--
View this message in context:
http://www.nabble.com/BundleContext.installBundle-won%27t-install-more-than-2-bundles.-tp25280408p25280408.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]