[ 
https://issues.apache.org/jira/browse/KARAF-3258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14160441#comment-14160441
 ] 

Jean-Baptiste Onofré commented on KARAF-3258:
---------------------------------------------

OK the problem is more global: it doesn't occur only for kar but actually for 
any feature defined as featuresBoot.

The problem comes from a change in the FeaturesServiceImpl:

{code}
diff --git 
a/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java
 
b/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java
index 70261ba..9c065e2 100644
--- 
a/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java
+++ 
b/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java
@@ -425,8 +425,7 @@ public class FeaturesServiceImpl implements FeaturesService 
{
                 Collections.sort(bundlesSortedByStartLvl, new 
Comparator<Bundle>() {
                     @Override
                     public int compare(Bundle bundle, Bundle bundle1) {
-                        return 
bundle.adapt(BundleStartLevel.class).getStartLevel()
-                                - 
bundle1.adapt(BundleStartLevel.class).getStartLevel();
+                        return state.bundleStartLevels.get(bundle) - 
state.bundleStartLevels.get(bundle1);
                     }
                 });
             }
{code}

The usage of adapt(BundleStartLevel.class).getStartLevel() changed the 
behavior. It works fine using the state.bundleStartLevels.get() method.

> KarService returns immediately after Kar install
> ------------------------------------------------
>
>                 Key: KARAF-3258
>                 URL: https://issues.apache.org/jira/browse/KARAF-3258
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-core, karaf-kar
>    Affects Versions: 3.0.2
>            Reporter: Andre Lanouette
>            Assignee: Jean-Baptiste Onofré
>            Priority: Blocker
>             Fix For: 4.0.0, 3.0.2
>
>
> In Karaf 3.0.x (up to 3.0.1), when deploying a KAR archive programatically 
> using the KarService.install(URI) method , the KAR archive would get 
> installed, its features would get started, and only then the method would 
> return. This can be very useful when we want to control precisely a 
> particular sequence of kar and service start and registration. 
> With the current version of Karaf-3.0.2-SNAPSHOT, the KarService return right 
> after the installation of the kar archive. Features do not get started before 
> the method returns. 
> This currently breaks our production build and tests because our plugin load 
> order sequence cannot be guaranteed anymore.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to