-
1. Re: Problem with hot deploy
ffang Jun 28, 2011 6:49 PM (in response to shamik)Hi,
I believe this is the expected behavior per OSGi spec.
You have installed bar-1.0.0.jar bundle, then you install bar-1.1.0.jar bundle, so the OSGi container now have two versions for bar, and the foo bundle already get resolved to pick up the bar-1.0.0, it won't re-resolve automatically to pick up the newer bar-1.1.0, unless you manually uninstall the old bar-1.0.0 and refresh the foo-1.0.0.
Freeman
-
2. Re: Problem with hot deploy
shamik Jun 28, 2011 8:10 PM (in response to ffang)Thanks for your reply Freeman. If I understand you correctly, here are the steps required to be followed for my scenario.
1. Drop bar 1.1.0 in deploy folder
2. Uninstall bar 1.1.0
3. Refresh foo 1.0.0.
Couple of questions, between uninstall of bar 1.0.0 and refresh of foo 1.0.0, what happens if a request is made to foo ? Since it has not been refreshed and older version of bar has been uninstalled, foo won't find a reference to bar. Will it cause an exception?
Secondly, is there a way to call the install / refresh command without logging into the karaf console or through webconsole ?
-
3. Re: Problem with hot deploy
ffang Jun 28, 2011 9:35 PM (in response to shamik)Hi,
I guess there's a typo in your scenario.
It should be
1. Drop bar 1.1.0 in deploy folder
2. Uninstall bar 1.0.0
3. Refresh foo 1.0.0.
IIRC, after you uninstall bar 1.0.0 and before you refresh foo 1.0.0, there should be a cache of bar 1.0.0 which foo 1.0.0 can still use as foo 1.0.0 already get resolved to pick up the bar 1.0.0. Anyway, you can get it a try and do a simple test here
And I think you can write a bundle which use OSGi api to install / refresh bundles, you may need google to get more details about how those api works.
Freeman
-
4. Re: Problem with hot deploy
shamik Jun 29, 2011 2:37 PM (in response to ffang)My bad, it was a typo indeed. As suggested, I verified the deploy steps by running a sample test. Uninstalling old bundle and refreshing the reference bundles made the new bundle visible.
As for the deployment, I'm looking into OSGi framework code. Thanks for the pointer.
Appreciate your help as always.