| Summary: | Insufficient diagnostics for uses constraint failure | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [RT] Virgo | Reporter: | Glyn Normington <glyn.normington> | ||||||
| Component: | runtime | Assignee: | Project Inbox <virgo-inbox> | ||||||
| Status: | CLOSED WORKSFORME | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | tjwatson | ||||||
| Version: | 3.0.1.RELEASE | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||
| URL: | http://www.eclipse.org/forums/index.php/bm/msg/263241/1/on/0/?SQ=aea272ed0a3ce4b5db3baa54bfb4fc84 | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
First zip too large for an attachment. I'll store it here for a while: http://dl.dropbox.com/u/2487064/neo4j-bundle.zip Second zip file also too large: http://dl.dropbox.com/u/2487064/spring-framework-dist-3.0.6.RELEASE.zip Interestingly I did manage to recreate the uses constraint failure with a pair of minimal bundles after observing that the "neo4j" super bundle exports javax.transaction and the other bundle imports it with a version range that makes it wire to the system bundle. However, the diagnostics in that case were as expected, i.e. much better:
[2011-12-09 16:49:53.692] fs-watcher <DE0002E> Installation of bundle 'toxic-user' version '0.0.0' failed. org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'toxic-user' at version '0.0.0': Cannot resolve: toxic-user
Resolver report:
Uses violation: <Import-Package: toxic; version="0.0.0"> in bundle <toxic-user_0.0.0[1323449391479]>
Found conflicts:
package 'javax.transaction_0.0.0' in bundle 'toxic-bundle_0.0.0[1323449391480]' used by 'toxic_0.0.0' in bundle 'toxic-bundle_0.0.0[1323449391480]'
conflicts with 'javax.transaction_1.1.0' in bundle 'org.eclipse.osgi_3.7.1.R37x_v20110808-1106[0]' imported by bundle 'toxic-user_0.0.0[1323449391479]'
package 'javax.transaction_0.0.0' in bundle 'toxic-bundle_0.0.0[1323449391480]' used by 'toxic_0.0.0' in bundle 'toxic-bundle_0.0.0[1323449391480]'
conflicts with 'javax.transaction_1.0.1' in bundle 'org.eclipse.osgi_3.7.1.R37x_v20110808-1106[0]' imported by bundle 'toxic-user_0.0.0[1323449391479]'
at org.eclipse.virgo.kernel.install.pipeline.stage.resolve.internal.QuasiResolveStage.process(QuasiResolveStage.java:46)
etc.
After debugging through UsesAnalyser, the reason that detailed diagnostics are not produced became clear: the conflicting import of, for example, javax.transaction is marked as optional and so the resolver is free to discard the import to avoid the conflict. It appears that Equinox did not discard the import in this case and so it failed with a uses violation that UsesAnalyser was not able to grok.
I beef up the minimal testcase to make the import of javax.transaction optional and the problem behaviour reproduced. To reproduce this failure, place the attached toxic-exporter.jar in repository/usr and the attached toxic-user-optional.jar in pickup and cold start Virgo. The diagnostics are as follows, because the UsesAnalyser can't see why the optional javax.transaction import was not discarded:
[2011-12-12 16:21:29.001] fs-watcher <DE0002E> Installation of bundle 'toxic-user' version '0.0.0' failed. org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'toxic-user' at version '0.0.0': Cannot resolve: toxic-user
Resolver report:
Uses violation: <Import-Package: toxic; version="0.0.0"> in bundle <toxic-user_0.0.0[1323706887184]>
Resolver reported uses conflict for import
Created attachment 208267 [details]
exports javax.transaction and toxic.export with uses on javax.transaction
Created attachment 208268 [details]
imports toxic.export and, optionally, javax.transaction tied to system bundle
The system bundle exports should be set to contain the following in order to reproduce this behaviour in vanilla Equinox: javax.transaction,\ javax.transaction;version="1.0.1",\ javax.transaction;version="1.1.0",\ Raised separate Equinox bug 366509 and closing this Virgo bug as "working as designed". |
The following diagnostics are produced: [2011-12-09 15:47:39.487] fs-watcher <DE0002E> Installation of bundle 'org.springframework.data.neo4j' version '2.0.0.BUILD-SNAPSHOT' failed. org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'org.springframework.data.neo4j' at version '2.0.0.BUILD-SNAPSHOT': Cannot resolve: org.springframework.data.neo4j Resolver report: Uses violation: <Import-Package: org.neo4j.kernel.impl.persistence; version="0.0.0"> in bundle <org.springframework.data.neo4j_2.0.0.BUILD-SNAPSHOT[1323445019050]> Resolver reported uses conflict for import Uses violation: <Import-Package: org.neo4j.index.impl.lucene; version="0.0.0"> in bundle <org.springframework.data.neo4j_2.0.0.BUILD-SNAPSHOT[1323445019050]> Resolver reported uses conflict for import Uses violation: <Import-Package: org.neo4j.kernel; version="0.0.0"> in bundle <org.springframework.data.neo4j_2.0.0.BUILD-SNAPSHOT[1323445019050]> Resolver reported uses conflict for import Uses violation: <Import-Package: org.neo4j.kernel.impl.transaction; version="0.0.0"> in bundle <org.springframework.data.neo4j_2.0.0.BUILD-SNAPSHOT[1323445019050]> Resolver reported uses conflict for import Uses violation: <Import-Package: org.neo4j.kernel.impl.nioneo.store; version="0.0.0"> in bundle <org.springframework.data.neo4j_2.0.0.BUILD-SNAPSHOT[1323445019050]> Resolver reported uses conflict for import Uses violation: <Import-Package: org.neo4j.kernel.impl.core; version="0.0.0"> in bundle <org.springframework.data.neo4j_2.0.0.BUILD-SNAPSHOT[1323445019050]> Resolver reported uses conflict for import at org.eclipse.virgo.kernel.install.pipeline.stage.resolve.internal.QuasiResolveStage.process(QuasiResolveStage.java:46) etc. which give little indication of the real problem which appears to be that the "Neo4j" bundle exports some packages with uses constraints on packages such as javax.transaction that it neither imports nor exports (the packages are provided in the bundle's classpath). Thus any bundle that attempts to wire to one of these package and javax.transaction or javax.transaction.xa will fail to resolve. However, this is just a theory. It helped the user find a fix, but when I tried to recreate this with a minimal example, the problem would not reproduce. Hence we are left with the problem of debugging the full set of bundles. Steps to reproduce: 1. Unzip neo4j-bundle.zip. (I will attempt to attach this to the bug.) 2. Unzip Virgo Tomcat Server 3.0.1.RELEASE and replace the repository/ext Spring 3.0.5 JARs with their 3.0.6 equivalents. 3. Place the contents of the repository/usr directory in the first unzip into Virgo's repository/usr. 4. Place the bundle neo4j-osgi-bundle-0.1-SNAPSHOT.jar from the pickup directory in the first unzip into Virgo's repository/usr. (This avoids an ordering issue in pickup.) 5. Place the bundle spring-data-neo4j-2.0.0.BUILD-SNAPSHOT.jar from the pickup directory in the first unzip into Virgo's pickup directory. 6. Start Virgo with bin/startup.sh -clean. 7. Observe the diagnostics appearing on the console.