1

The bndtools Eclipse plugin consistently reports a 'uses constraint violation' for logback that I just have not been able to track down (I've been through every related question that I can find on StackOverflow and Google).

The constraint violation shows up every time I modify a 'run configuration' and eventually disappears after enough project clean/rebuilds and Eclipse restarts (the muttered invocations to sundry gods and occasional chicken sacrifice may also have something to do with it).

Nothing in my workspace seems to export logback directly so it's not clear what is causing the two conflicting chains - it may be one of the Felix bundles or SLF4J, but that also seems unlikely.

Partial list of bundles:

osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.shell)',\
osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.command)',\
osgi.identity;filter:='(osgi.identity=org.apache.felix.log)',\
osgi.identity;filter:='(osgi.identity=slf4j.api)',\
osgi.identity;filter:='(osgi.identity=ch.qos.logback.core)',\
osgi.identity;filter:='(osgi.identity=ch.qos.logback.classic)',\

The constraint violation report:

Uses constraint violation. Unable to resolve resource ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2] because it is exposed to package 'ch.qos.logback.classic.spi' from resources ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2] and ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2] via two dependency chains.

Chain 1:   ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2]
    import: (&(osgi.wiring.package=ch.qos.logback.classic.spi)(version>=1.1.0))
     |
    export: osgi.wiring.package: ch.qos.logback.classic.spi   ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2]

Chain 2:   ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2]
    import: (&(osgi.wiring.package=ch.qos.logback.classic.spi)(version>=1.1.0)(!(version>=2.0.0)))
     |
    export: osgi.wiring.package: ch.qos.logback.classic.spi   ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2] org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2] because it is exposed to package 'ch.qos.logback.classic.spi' from resources ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2] and ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2] via two dependency chains.

Chain 1:   ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2]
    import: (&(osgi.wiring.package=ch.qos.logback.classic.spi)(version>=1.1.0))
     |
    export: osgi.wiring.package: ch.qos.logback.classic.spi   ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2]

Chain 2:   ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2]
    import: (&(osgi.wiring.package=ch.qos.logback.classic.spi)(version>=1.1.0)(!(version>=2.0.0)))
     |
    export: osgi.wiring.package: ch.qos.logback.classic.spi   ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2]     at org.apache.felix.resolver.ResolverImpl.checkDynamicPackageSpaceConsistency(ResolverImpl.java:1133)   at org.apache.felix.resolver.ResolverImpl.checkPackageSpaceConsistency(ResolverImpl.java:1086)  at org.apache.felix.resolver.ResolverImpl.checkDynamicPackageSpaceConsistency(ResolverImpl.java:1402)   at org.apache.felix.resolver.ResolverImpl.checkPackageSpaceConsistency(ResolverImpl.java:1086)  at org.apache.felix.resolver.ResolverImpl.checkDynamicPackageSpaceConsistency(ResolverImpl.java:1402)   at org.apache.felix.resolver.ResolverImpl.checkPackageSpaceConsistency(ResolverImpl.java:1086)  at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:260)    at biz.aQute.resolve.ResolveProcess.resolveRequired(ResolveProcess.java:34)     at org.bndtools.core.resolve.ResolveOperation.run(ResolveOperation.java:61)     at org.bndtools.core.resolve.ResolveJob.run(ResolveJob.java:43)     at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Is there a way to troubleshoot this ? I'd even be really happy for just a consistent workaround ..

tonys
  • 3,855
  • 33
  • 39
  • That's a pretty weird error message; it looks like a bug to me. Please report in the bndtools [issue tracker](http://github.com/bndtools/bndtools/issues) with steps to reproduce. – Neil Bartlett Nov 30 '15 at 20:35
  • BTW if this is showing up every time you modify a run configuration, you should probably turn off "auto-resolve on save" (wish I'd never implemented that feature now). – Neil Bartlett Nov 30 '15 at 20:37
  • @NeilBartlett, I turned off auto-resolve yonks ago - it shows up with a manual resolve as well, which is kind of expected. I'll log it on bndtools but steps to reproduce isn't going to be easy - I'll see if I can create a minimal project with the same problem. – tonys Dec 01 '15 at 06:45
  • @NeilBartlett, I haven't been able to reproduce this often enough to file a useful bug report. I suspect it's a combination of something with logback and something in the structure of my project. It's still present but removing logback from the explicit modules list has reduced the severity to an occasional nuisance. – tonys Apr 11 '16 at 10:46

0 Answers0