Community

On demand resolution

reply from Adrian Brock in JBoss Microcontainer Development - View the full discussion

This patch resolves the issue. It was only resetting the state if DeployerClient.change() threw a DeploymentException,

while in this case, there's no exception it is just incomplete.

 

core/src/main/java/org/jboss/osgi/framework/packageadmin
$ svn diff
Index: PackageAdminImpl.java
===================================================================
--- PackageAdminImpl.java    (revision 103305)
+++ PackageAdminImpl.java    (working copy)
@@ -347,6 +347,18 @@
       {
          log.error("Error resolving bundles: " + resolvableBundles, ex);
          allResolved = false;
+        
+         // Reset the required state for bundles that didn't get resolved
+         for (OSGiBundleState bundleState : resolvableBundles)
+         {
+            if (bundleState.getState() == Bundle.INSTALLED)
+            {
+               DeploymentUnit unit = bundleState.getDeploymentUnit();
+               unit.setRequiredStage(DeploymentStages.DESCRIBE);
+               ControllerContext ctx = unit.getAttachment(ControllerContext.class);
+               ctx.setRequiredState(ControllerState.newState(DeploymentStages.DESCRIBE.getName()));
+            }
+         }
       }
      
       return allResolved;

Reply to this message by going to Community

Start a new discussion in JBoss Microcontainer Development at Community