| Summary: | Document stricter processing of Require-Bundle by Equinox 3.7 in Virgo 3.0 migration notes | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [RT] Virgo | Reporter: | Mario Scalas <mario.scalas> | ||||
| Component: | runtime | Assignee: | Glyn Normington <glyn.normington> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P3 | CC: | glyn.normington, hsiliev | ||||
| Version: | 3.0.0.M03 | Flags: | glyn.normington:
documentation+
|
||||
| Target Milestone: | 3.0.0.M04 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 193422 [details]
Bundles + Plans to reproduce the problem (must be installed as described in the report)
This are the dependencies:
* two plans (one for installing H2, the other for the plugin which triggers the problem)
* the H2 bundle
* the database starter plugin.
Installing only the H2 plan (it.amtservice.ido2.util-1.0.0.SNAPSHOT.plan) works fine (the bundle is correctly installed in the runtime). When the it.amtservice.ido2-1.0.0.SNAPSHOT.plan is installed (which uses the H2 bundle), then the problem happens.
Seems like the Require-Bundle header in it.amtservices.ido2.infrastructure.database.starter-1.0.0.SNAPSHOT.jar has to be changed to have bundle-version as an attribute: Require-Bundle: org.h2;bundle-version="[1.3.148,2.0.0)" Replacing version with bundle-version solved the problem. Virgo now runs on Equinox 3.7, which seems to be more strict with regards to headers/attributes. This would also explain why the bundle was running well before. For more info check the OSGi specification (3.12.1 Require-Bundle / pages 70-72 for 4.2). I wonder if we could (or in fact should) cover this case with additional checks and more information on how to solve the problem. You are right! Replacing (for example): Require-Bundle: org.h2;version="[1.3.0, 2.0.0)" into: Require-Bundle: org.h2;bundle-version="[1.3.0, 2.0.0)" has worked for me. I had few other bundles that used that form so I'll have to tweak them too. Perhaps a "migration to Virgo 3.0.0" guide should contain the hint since at runtime Virgo is pretty musch obscure about the issue (until one knows where to look ;)) Thanks Hristo. This may be closed for me. Let's use this bug to update the migration notes for 3.0. Changing the title to match. Tagging for M04 release notes, even though this is independent of the milestone. |
Build Identifier: 3.0.0.M03 I use the H2 database and I use it with success in virgo 2.1.0: I wanted to test my application on latest milestone (actually 3.0.0.M03). I've done the following steps: * modified my previous plan to use the new Virgo XSD (used DM Server XSD before) * copied the 2 required jars in $VIRGO_HOME/repository/usr * h2-1.3.154.jar (downloaded straight from http://www.h2database.com (which is OSGi-enabled from a long time and always worked fine in my Eclipse/OSGi-based apps) * it.amtservices.ido2.infrastructure.database.starter-1.0.0.SNAPSHOT.jar (my application bundle which just starts the database server as a spring bean). It has always worked but in this example is only required to demonstrate that the h2 bundle can't be found. * Copied the plans in $VIRGO_HOME/pickup * started Virgo At runtime I get: ... [2011-04-16 20:39:42.937] fs-watcher <HD0003E> Hot re-deploy f ailed for file 'it.amtservice.ido2-1.0.0.SNAPSHOT.plan'. org.eclipse.virgo.kerne l.deployer.core.DeploymentException: Dependency satisfaction failed at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationD eployer.driveInstallPipeline(PipelinedApplicationDeployer.java:288) at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationD eployer.doInstall(PipelinedApplicationDeployer.java:164) at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationD eployer.install(PipelinedApplicationDeployer.java:136) at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationD eployer.deploy(PipelinedApplicationDeployer.java:203) at org.eclipse.virgo.kernel.deployer.hot.HotDeploymentFileSystemListener .deploy(HotDeploymentFileSystemListener.java:174) at org.eclipse.virgo.kernel.deployer.hot.HotDeploymentFileSystemListener .onChange(HotDeploymentFileSystemListener.java:81) at org.eclipse.virgo.util.io.FileSystemChecker.notifyListeners(FileSyste mChecker.java:245) at org.eclipse.virgo.util.io.FileSystemChecker.check(FileSystemChecker.j ava:166) at org.eclipse.virgo.kernel.deployer.hot.WatchTask.run(WatchTask.java:58 ) at java.lang.Thread.run(Thread.java:662) Caused by: org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependen ciesException: Unable to satisfy dependencies of bundle 'it.amtservices.ido2.inf rastructure.database.starter' at version '1.0.0.SNAPSHOT': Cannot resolve: it.am tservices.ido2.infrastructure.database.starter Resolver report: A Require-Bundle could not be resolved. Caused by missing constraint in bundle <it.amtservices.ido2.infrastructure.database.starter_1.0.0.SNAPSHOT> constraint: <Require-Bundle: org.h2; bundle-version="0.0.0"> This happens even with a clean virgo installation (just added the bundles and plans): the H2 bundle seems pretty fine both to me, Eclipse RCP applications and Virgo 2.1.0 so I think something has changed in Virgo :S Reproducible: Always Steps to Reproduce: 1. Put the two JARS in $VIRGO_HOME/repository/usr 2. Put the two plans in $VIRGO_HOME/pickup 3. start virgo 4. Get the exception