[jboss-user] [JBoss Microcontainer Development] - On demand resolution

Adrian Brock do-not-reply at jboss.com
Wed Mar 31 06:06:20 EDT 2010

Adrian Brock [http://community.jboss.org/people/adrian%40jboss.org] replied to the discussion

"On demand resolution"

To view the discussion, visit: http://community.jboss.org/message/534854#534854

> Thomas Diesler wrote:
> This  http://fisheye.jboss.org/changelog/JBossOSGi/projects/runtime/framework/trunk?cs=103244 change causes  http://jbmuc.dyndns.org:8280/hudson/job/jbossosgi-git-staging/22/testReport/ regression in bundle lifecycle handling. I added test coverage for this in the framework's  http://fisheye.jboss.org/browse/JBossOSGi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleLifecycleTestCase.java?r=103300 BundleLifecycleTestCase
> <snip/>
>  I still need to look into the details of why this would happen.
It's happening because B's deployment unit has required-stage of "CLASSLOADER" (RESOLVED in OSGi) after the start() failed.
i.e. it wants to resolve it.

So when you install bundleX, it also says, hey B is not in the correct state and I can resolve it now,
but only by moving X to ClassLoader as well.

That is what lazy resolve is all about. It automatically resolves other classloaders that it needs if they are not resolved.

If B went back to required-stage "DESCRIBE" (INSTALLED in OSGi) after the start() failed then your test would work as expected.

I worked this out by adding the following to the test after the b.start() failure:

         OSGiBundleState bs = (OSGiBundleState) getBundleManager().getBundleState(bundleB);
         System.out.println(bundleB.getSymbolicName() + " state=" + ConstantsHelper.bundleState(bundleB.getState()) + " required=" + bs.getDeploymentUnit().getRequiredStage());

Which produces:
lifecycle-bundleB state=INSTALLED required=ClassLoader

So you can see the bundle state is inconsistent with the deployment unit state.


Reply to this message by going to Community

Start a new discussion in JBoss Microcontainer Development at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100331/7b2e3748/attachment.html 

More information about the jboss-user mailing list