|Re: Help me understand the uses violation [message #632010 is a reply to message #631988]
||Mon, 11 October 2010 08:13
| Glyn Normington
Registered: July 2009
Glad this particular problem is solved.
If you would like to understand uses constraint violations better, take a look at these blogs.
Note that the diagnostics produced by Virgo are a post-processed form of an Equinox resolver error. We have a heuristic algorithm that tries to simplify the diagnostics and present the root cause. Because of the complexity of uses constraints, this is not always possible, but we have beefed up the algorithm several times to be progressively better, so it often produces useful hints.
Also you should find the Virgo admin console useful in such situations. Virgo attempts to resolve deployed applications in a "side state" before committing bundles to the OSGi framework. If resolution fails, e.g. because of a uses constraint violation, then the side state is dumped to a file and a message is written to stdout and the event log file noting the name of the dump. The OSGi state inspector in the admin console may then be used to analyse the dump. Since the dump was taken at the point of failure, you can inspect the partial wiring that the resolver was working with when it failed to resolve.
The main complication in diagnosing such failures is that the resolver is not guaranteed to fail with the simplest error as it may back-track several times trying to find a wiring solution which satisfies all the constraints. Only when it finally runs out of possibilities does it fail and this may be on a more complex, rather than the simplest possible, error. Resolution is a NP complete problem, so the resolver can probably be forgiven for this behaviour.
But the thing to bear in mind is that a uses constraint violation is always the result of some package being exported from two or more bundles. The blogs above explain this in much more detail.
Powered by FUDForum
. Page generated in 0.02562 seconds