Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Requiring org.slf4j.api causes uses violations in empty server
Requiring org.slf4j.api causes uses violations in empty server [message #1015586] Fri, 01 March 2013 09:50 Go to next message
Franck Mising name is currently offline Franck Mising nameFriend
Messages: 91
Registered: July 2009
Location: France
Member
Hi, I am getting uses violations while trying to deploy bundles that require org.slf4j.api.

If I start from a fresh Virgo 3.6.0 install, create a single com.acme.test bundle in repository/usr with this manifest:

Manifest-Version: 1.0
Bnd-LastModified: 1362062335528
Build-Jdk: 1.7.0_11
Bundle-ManifestVersion: 2
Bundle-Name: com.acme.test
Bundle-SymbolicName: com.acme.test
Bundle-Version: 1.0.0
Created-By: Apache Maven Bundle Plugin
Require-Bundle: org.slf4j.api;bundle-version="1.7.2"


I get this violation when trying to deploy the bundle:

Caused by: org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'com.acme.test' at version '1.0.0': Cannot resolve: com.acme.test
    Resolver report:
        A Require-Bundle could not be resolved because of a uses directive conflict. Resolver error data <Require-Bundle: org.slf4j.api; bundle-version="1.7.2">. Caused by missing constraint in bundle <com.acme.test_1.0.0>
             constraint: <Require-Bundle: org.slf4j.api; bundle-version="1.7.2">
        A Require-Bundle could not be resolved because of a uses directive conflict. Resolver error data <Require-Bundle: ch.qos.logback.classic; bundle-version="[1.0.7,1.0.8)">. Caused by missing constraint in bundle <ch.qos.logback.slf4j_1.0.7.v20121108-1250>
             constraint: <Require-Bundle: ch.qos.logback.classic; bundle-version="[1.0.7,1.0.8)">


I have no idea how to resolve this, any pointers would be very welcome! I have attached the complete log file.
  • Attachment: log.log
    (Size: 377.16KB, Downloaded 121 times)
Re: Requiring org.slf4j.api causes uses violations in empty server [message #1016413 is a reply to message #1015586] Wed, 06 March 2013 11:42 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Please could you confirm the manifest of the test bundle does not contain

Require-Bundle ch.qos.logback.classic; bundle-version="[1.0.7,1.0.8)"


I'm wondering where that comes from...
Re: Requiring org.slf4j.api causes uses violations in empty server [message #1016431 is a reply to message #1016413] Wed, 06 March 2013 12:54 Go to previous messageGo to next message
Franck Mising name is currently offline Franck Mising nameFriend
Messages: 91
Registered: July 2009
Location: France
Member
That is correct, a single require for slf4j.

I read in another post that " because the slf4f bundles are exported from the kernel to the user region they can't be included via require-bundle"; and indeed using Import-Package the pb goes away... The issue being that I have tens of 3rd party bundles to integrate and they all use require bundle on those bundles...

Franck
Re: Requiring org.slf4j.api causes uses violations in empty server [message #1016462 is a reply to message #1016431] Wed, 06 March 2013 14:47 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
If you don't mind getting your hands slightly dirty, you could write a transformer to plug into the Virgo deployment pipeline and rewrite those require-bundle statements as appropriate package imports.

Alternatively, have you tried playing around with adding the slf4j api bundle to the bundleImports property in the user region configuration file? I don't know of anyone else attempting that, but it should be a quick experiment.

[Updated on: Wed, 06 March 2013 14:47]

Report message to a moderator

Re: Requiring org.slf4j.api causes uses violations in empty server [message #1017351 is a reply to message #1016462] Mon, 11 March 2013 16:33 Go to previous messageGo to next message
Franck Mising name is currently offline Franck Mising nameFriend
Messages: 91
Registered: July 2009
Location: France
Member
Thanks Glynn,

Replacing the 3 slf4j packageImports directives by a single bundleImports directive (in org.eclipse.virgo.kernel.userregion.properties) seems to do the trick.

The console/admin bundles don't seem affected, I'll post here if I notice any issue with the approach.

Franck
Re: Requiring org.slf4j.api causes uses violations in empty server [message #1017357 is a reply to message #1017351] Mon, 11 March 2013 16:54 Go to previous message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Thanks for reporting back Franck.
Previous Topic:Not able to load Run Time JRE class: com.sun.crypto.provider.SunJCE
Next Topic:Problem deploying CXF JAX-RS services in Virgo
Goto Forum:
  


Current Time: Mon Dec 22 12:06:34 GMT 2014

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

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