You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by marfij <ma...@wp.pl> on 2017/01/25 08:24:55 UTC

Problems with start level when installing bundles with the same host and different fragment.

Hi all,
 my case is as follows:
 
- Bundle "Bundle-A" have a feature with "Bundle-Host" and
"Bundle-Fragment-1"
- Bundle "Bundle-B" have a feature with "Bundle-Host" (the same one as
"Bundle-A"), "Bundle-Fragment-1"  (the same one as "Bundle-A") and
"Bundle-Fragment-2" 
 
 Steps:
 1. Bundle-A is installed first, all its dependencies are resolved and the
status is Active
 2. Bundle-B starts to be installed
 3. Bundle-B depends on the same "Bundle-Host" but have different set of the
fragments and as a result,  
  "Bundle-Host" is refreshed
 4. Bundle-A is stopped because the "Bundle-Host" is not available during
the refresh process
 5. Bundle-A is Installed. It cannot be Active because the "Bundle-Host"
start level is now diffrent. 
 
 The error says:
 
 FrameworkEvent ERROR - com.my.bundle.host-my-bundle-host
org.osgi.framework.BundleException: Cannot start bundle
com.my.bundle.host-my-bundle-host [134] because its start level is 60, which
is greater than the framework's start level of 25.
	at org.apache.felix.framework.Felix.startBundle(Felix.java:1931) [na:na]
	at org.apache.felix.framework.Felix$RefreshHelper.restart(Felix.java:4844)
[na:na]
	at org.apache.felix.framework.Felix.refreshPackages(Felix.java:4122)
[na:na]
	at
org.apache.felix.framework.FrameworkWiringImpl.run(FrameworkWiringImpl.java:178)
[na:na]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_102]
 
 
The workaround for that would be to define the same set of fragments for
both "Bundle-A" and "Bundle-B". But it's not the preferred way because
"Bundle-A" doesn't need the "Bundle-Fragment-2" and I don't want to add it
just to avoid the start level problems. 
 
Karaf version is 3.0.6
 
Can you please suggest me how this can be fixed?



-----
Regards,
 marfij
--
View this message in context: http://karaf.922171.n3.nabble.com/Problems-with-start-level-when-installing-bundles-with-the-same-host-and-different-fragment-tp4049320.html
Sent from the Karaf - User mailing list archive at Nabble.com.