Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Help me understand the uses violation
Help me understand the uses violation [message #631897] Sun, 10 October 2010 07:58 Go to next message
Thomas Kratz is currently offline Thomas KratzFriend
Messages: 163
Registered: July 2009
Senior Member
First of all I think the uses violation could tell which package actually conflicts, I have been fighting with it all day now.

By now I get:
Uses violation: <Import-Package: org.springframework.web.jsf.el; version="0.0.0"> in bundle <eiswind-publishing-server.plan-1-de.eiswind.mango.server.core_1.7.0>
             Resolver reported uses conflict for import constrained to bundle <org.springframework.web> constrained bundle version range "[3.0.0.RELEASE,3.0.0.RELEASE]"


Which seemed to be obvious as I exported javax.el from my jackrabbit bundle. But then I removed the export from the jackrabbit bundle and I still get the uses violation. I have no export of that package anymore in my deployment but still it fails. I thought even with Import-Bundle I can only import packages that are exported by the other bundle. What am I getting wrong here ?

BTW I didnt make it to get jpa2 working for dependencies on javax.persistence that conflict between spring.orm and some cataline thingys (dont remember excactly) should I open a bugzilla for that ?

Cheers Thomas
Re: Help me understand the uses violation [message #631909 is a reply to message #631897] Sun, 10 October 2010 13:21 Go to previous messageGo to next message
Thomas Kratz is currently offline Thomas KratzFriend
Messages: 163
Registered: July 2009
Senior Member
Once again, the spring.web manifest goes like

(in Export-Package)
org.springframework.web.jsf.el;version="3.0.0.RELEASE";uses:="javax.el,org.springframework.beans.factory,org.springframework.beans.factory.access.el ,org.springframework.web.context"


so I guess it must be javax.el thats conflicting. I have it twice in some bigger framework bundles, but nowhere exported. I also completely removod both bundles containig the libs and still get this error. I feel so lost.
Re: Help me understand the uses violation [message #631988 is a reply to message #631897] Mon, 11 October 2010 07:21 Go to previous messageGo to next message
Thomas Kratz is currently offline Thomas KratzFriend
Messages: 163
Registered: July 2009
Senior Member
OK I had to make a "clean" from the spring tools. Publish didn't make it. Problem solved.
Re: Help me understand the uses violation [message #632010 is a reply to message #631988] Mon, 11 October 2010 08:13 Go to previous message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Hi Thomas

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.
Previous Topic:NoClassDefFoundError when starting Virgo milestone 5 from tooling
Next Topic:GreenPages solution doesn't run on Virgo web server M06
Goto Forum:
  


Current Time: Thu Dec 18 21:14:03 GMT 2014

Powered by FUDForum. Page generated in 0.07702 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software