Details

      Description

      I have an Eclipse Mars install and installed Directory Studio using the Eclipse Marketplace.

      After the installation is performed I have multiple error FrameworkEvents logged regarding bundle installations. All of them bubble down to a uses constraint violation.

       Bundle was not resolved because of a uses contraint violation.
        org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource slf4j.api [osgi.identity; osgi.identity="slf4j.api"; type="osgi.bundle"; version:Version="1.7.10"] because it exports package 'org.slf4j.helpers' and is also exposed to it from resource org.slf4j.api [osgi.identity; osgi.identity="org.slf4j.api"; type="osgi.bundle"; version:Version="1.7.2.v20121108-1250"] via the following dependency chain:
      
        slf4j.api [osgi.identity; osgi.identity="slf4j.api"; type="osgi.bundle"; version:Version="1.7.10"]
          import: (&(osgi.wiring.package=org.slf4j.impl)(version>=1.6.0))
           |
          export: osgi.wiring.package=org.slf4j.impl; uses:=null
        org.slf4j.api [osgi.identity; osgi.identity="org.slf4j.api"; type="osgi.bundle"; version:Version="1.7.2.v20121108-1250"]
          require: (&(osgi.wiring.bundle=ch.qos.logback.classic)(&(bundle-version>=1.0.7)(!(bundle-version>=1.0.8))))
           |
          provide: osgi.wiring.bundle; bundle-version:Version="1.0.7.v20121108-1250"; osgi.wiring.bundle="ch.qos.logback.classic"
        ch.qos.logback.classic [osgi.identity; osgi.identity="ch.qos.logback.classic"; type="osgi.bundle"; version:Version="1.0.7.v20121108-1250"]
          import: (&(osgi.wiring.package=org.slf4j.helpers)(version>=1.7.0))
           |
      1. DIRSTUDIO-1068.patch
        6 kB
        Stefan Seelmann
      2. eclipse-mars-error.log
        32 kB
        Robert Munteanu

        Activity

        Hide
        rombert Robert Munteanu added a comment -

        Attached error log entry.

        Show
        rombert Robert Munteanu added a comment - Attached error log entry.
        Hide
        seelmann Stefan Seelmann added a comment -

        Which Eclipse package (Java, JEE, RCP, PHP, ...) do you use?

        It seems there is a conflict with slf4j, 1.7.2.v20121108-1250 is installed but the API wants 1.7.10. Ah, I remember, that seems to be related to DIRAPI-233 so hopefully is fixed.

        But nevertheless slf4j 1.7.10 plugin should be installed, can you check?

        Show
        seelmann Stefan Seelmann added a comment - Which Eclipse package (Java, JEE, RCP, PHP, ...) do you use? It seems there is a conflict with slf4j, 1.7.2.v20121108-1250 is installed but the API wants 1.7.10. Ah, I remember, that seems to be related to DIRAPI-233 so hopefully is fixed. But nevertheless slf4j 1.7.10 plugin should be installed, can you check?
        Hide
        rombert Robert Munteanu added a comment -

        I am running Eclipse Java EE IDE for Web Developers:

        1. Version: Mars Release (4.5.0)
        2. Build id: 20150621-1200

        But I've also installed the PHP tools in it. The slf4j-related bundles that I could find are

        osgi> lb slf4j
        START LEVEL 6
           ID|State      |Level|Name
          872|Resolved   |    4|SLF4J API (1.7.2.v20121108-1250)
          873|Resolved   |    1|SLF4J LOG4J-12 Binding (1.7.2.v20131105-2200)
         1568|Resolved   |    1|Logback Native SLF4J Logger (1.0.7.v201505121915)
         1648|Resolved   |    4|slf4j-simple for use in m2e embedded maven runtime  (1.6.0.20150526-2031)
         1948|Installed  |    4|slf4j-api (1.7.10)
        

        The last bundle only appears after install Directory Studio.

        Show
        rombert Robert Munteanu added a comment - I am running Eclipse Java EE IDE for Web Developers: Version: Mars Release (4.5.0) Build id: 20150621-1200 But I've also installed the PHP tools in it. The slf4j-related bundles that I could find are osgi> lb slf4j START LEVEL 6 ID|State |Level|Name 872|Resolved | 4|SLF4J API (1.7.2.v20121108-1250) 873|Resolved | 1|SLF4J LOG4J-12 Binding (1.7.2.v20131105-2200) 1568|Resolved | 1|Logback Native SLF4J Logger (1.0.7.v201505121915) 1648|Resolved | 4|slf4j-simple for use in m2e embedded maven runtime (1.6.0.20150526-2031) 1948|Installed | 4|slf4j-api (1.7.10) The last bundle only appears after install Directory Studio.
        Hide
        seelmann Stefan Seelmann added a comment -

        I was able to reproduce the problem.

        When installing via Eclipse Market Place one plugin "Apache Directory Studio SLF4J to Eclipse Log Binding" isn't installed because it's not included in any feature. It is only included within the RCP product, for installation in Eclipse it is intentionally optional because I'm not sure if may cause issues.

        But as soon as it is installed (via http://directory.apache.org/studio/update/ update site) the slf4j-api 1.7.10 can also be resolved. But to be honest I don't have a clue what makes the difference, do you have any idea?

        Anyway, I hope that with DIRAPI-233 and update to LDAP API 1.0.0-M31 the additional slf4j-api 1.7.10 won't be required any more. I'll test when I find some time.

        Show
        seelmann Stefan Seelmann added a comment - I was able to reproduce the problem. When installing via Eclipse Market Place one plugin "Apache Directory Studio SLF4J to Eclipse Log Binding" isn't installed because it's not included in any feature. It is only included within the RCP product, for installation in Eclipse it is intentionally optional because I'm not sure if may cause issues. But as soon as it is installed (via http://directory.apache.org/studio/update/ update site) the slf4j-api 1.7.10 can also be resolved. But to be honest I don't have a clue what makes the difference, do you have any idea? Anyway, I hope that with DIRAPI-233 and update to LDAP API 1.0.0-M31 the additional slf4j-api 1.7.10 won't be required any more. I'll test when I find some time.
        Hide
        rombert Robert Munteanu added a comment -

        But to be honest I don't have a clue what makes the difference, do you have any idea?

        I see that the slf4j-api bundle included in DirectoryStudio has an Import-Package statement ( strange for an API bundle )

         Export-Package = org.slf4j;version=1.7.10, org.slf4j.spi;version=1.7.10, org.slf4j.helpers;version=1.7.10
         Import-Package = org.slf4j.impl;version=1.6.0
        

        That package is exported by the logback bundle, which in turns imports org.slf4j.helpers from the other slf4j bundle, which is the root cause of the uses constraint violation. With this wiring the slf4j-api bundle would be exposed to the same package exported by two bundles.

        I looked at the update site and noticed that the log binding features pulls in the org.apache.directory.studio.slf4j-eclipselog, which exports the 'impl' package and is actually a fragment bundle:

        Fragment-Host: slf4j.api;bundle-version="[1.7.10,1.7.11)"
        Export-Package: org.slf4j.impl;version="2.0.0"
        

        This means that the slf4j-api bundle no longer has to be wired to the logback-core bundle to be resolved, which explains why this works.

        Anyway, I hope that with DIRAPI-233 and update to LDAP API 1.0.0-M31 the additional slf4j-api 1.7.10 won't be required any more. I'll test when I find some time.

        Is there a way I can test these changes myself?

        Show
        rombert Robert Munteanu added a comment - But to be honest I don't have a clue what makes the difference, do you have any idea? I see that the slf4j-api bundle included in DirectoryStudio has an Import-Package statement ( strange for an API bundle ) Export-Package = org.slf4j;version=1.7.10, org.slf4j.spi;version=1.7.10, org.slf4j.helpers;version=1.7.10 Import-Package = org.slf4j.impl;version=1.6.0 That package is exported by the logback bundle, which in turns imports org.slf4j.helpers from the other slf4j bundle, which is the root cause of the uses constraint violation. With this wiring the slf4j-api bundle would be exposed to the same package exported by two bundles. I looked at the update site and noticed that the log binding features pulls in the org.apache.directory.studio.slf4j-eclipselog, which exports the 'impl' package and is actually a fragment bundle: Fragment-Host: slf4j.api;bundle-version= "[1.7.10,1.7.11)" Export-Package: org.slf4j.impl;version= "2.0.0" This means that the slf4j-api bundle no longer has to be wired to the logback-core bundle to be resolved, which explains why this works. Anyway, I hope that with DIRAPI-233 and update to LDAP API 1.0.0-M31 the additional slf4j-api 1.7.10 won't be required any more. I'll test when I find some time. Is there a way I can test these changes myself?
        Hide
        seelmann Stefan Seelmann added a comment -

        Wow, thanks you very much for the detailed diagnostics and description of the problem.

        The slf4j-api 1.7.10 bundle is the original one, downloaded from maven central. this contains the Import-Package statement. We should consider to exclude it and use the org.slf4j.api_1.7.2.v20121108-1250.jar which seems to be modified bacause it lacks the Import-Package statement. Still the org.slf4j.LoggerFactory class imports org.slf4j.impl.StaticLoggerBinder...

        To test the changes checkout the Studio sources. Please see the developer guide https://directory.apache.org/studio/developers-guide.html and the readme https://github.com/apache/directory-studio. The main pom.xml already contains the new LDAP API 1.0.0-M31 dependency.

        Show
        seelmann Stefan Seelmann added a comment - Wow, thanks you very much for the detailed diagnostics and description of the problem. The slf4j-api 1.7.10 bundle is the original one, downloaded from maven central. this contains the Import-Package statement. We should consider to exclude it and use the org.slf4j.api_1.7.2.v20121108-1250.jar which seems to be modified bacause it lacks the Import-Package statement. Still the org.slf4j.LoggerFactory class imports org.slf4j.impl.StaticLoggerBinder ... To test the changes checkout the Studio sources. Please see the developer guide https://directory.apache.org/studio/developers-guide.html and the readme https://github.com/apache/directory-studio . The main pom.xml already contains the new LDAP API 1.0.0-M31 dependency.
        Hide
        seelmann Stefan Seelmann added a comment -

        I was able to exclude the slf4j-api 1.7.10, and tried to use the 1.7.2.v20121108-1250, but unfortunately Mina has a minimum requirement of 1.7.7. I'll try to patch Mina to accept any 1.7.x as we did for the LDAP API.

        Show
        seelmann Stefan Seelmann added a comment - I was able to exclude the slf4j-api 1.7.10, and tried to use the 1.7.2.v20121108-1250, but unfortunately Mina has a minimum requirement of 1.7.7. I'll try to patch Mina to accept any 1.7.x as we did for the LDAP API.
        Hide
        seelmann Stefan Seelmann added a comment -

        FTR: With patched Mina it works, I'll file an issue there.

        Show
        seelmann Stefan Seelmann added a comment - FTR: With patched Mina it works, I'll file an issue there.
        Hide
        seelmann Stefan Seelmann added a comment -

        Filed DIRMINA-1020. Attached patch depends on DIRMINA-1020.

        Show
        seelmann Stefan Seelmann added a comment - Filed DIRMINA-1020 . Attached patch depends on DIRMINA-1020 .
        Hide
        rombert Robert Munteanu added a comment -

        Ah, thanks for letting me know. I'll wait for at least a Mina snapshot then

        Show
        rombert Robert Munteanu added a comment - Ah, thanks for letting me know. I'll wait for at least a Mina snapshot then
        Hide
        elecharny Emmanuel Lecharny added a comment -

        I'll try to cut a new release soon... There is another change I want to inject in MINA, declaring the threads as daemons.

        Show
        elecharny Emmanuel Lecharny added a comment - I'll try to cut a new release soon... There is another change I want to inject in MINA, declaring the threads as daemons.
        Hide
        richard.evans@blueallegro.net Richard Evans added a comment -

        With Eclipse Mars 4.5 GA, I see a slightly different error:

        Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature
        at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:336)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:284)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:305)
        at org.apache.directory.api.ldap.model.name.Dn.<clinit>(Dn.java:72)
        at org.apache.directory.studio.ldapbrowser.core.model.impl.RootDSE.<init>(RootDSE.java:57)
        at org.apache.directory.studio.ldapbrowser.core.model.impl.BrowserConnection.<init>(BrowserConnection.java:129)
        at org.apache.directory.studio.ldapbrowser.core.BrowserConnectionManager.loadBrowserConnections(BrowserConnectionManager.java:442)
        at org.apache.directory.studio.ldapbrowser.core.BrowserConnectionManager.<init>(BrowserConnectionManager.java:89)
        at org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin.start(BrowserCorePlugin.java:82)
        at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
        at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
        ... 154 more

        I assume this has the same root cause?

        Show
        richard.evans@blueallegro.net Richard Evans added a comment - With Eclipse Mars 4.5 GA, I see a slightly different error: Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:336) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:284) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:305) at org.apache.directory.api.ldap.model.name.Dn.<clinit>(Dn.java:72) at org.apache.directory.studio.ldapbrowser.core.model.impl.RootDSE.<init>(RootDSE.java:57) at org.apache.directory.studio.ldapbrowser.core.model.impl.BrowserConnection.<init>(BrowserConnection.java:129) at org.apache.directory.studio.ldapbrowser.core.BrowserConnectionManager.loadBrowserConnections(BrowserConnectionManager.java:442) at org.apache.directory.studio.ldapbrowser.core.BrowserConnectionManager.<init>(BrowserConnectionManager.java:89) at org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin.start(BrowserCorePlugin.java:82) at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771) at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764) ... 154 more I assume this has the same root cause?
        Hide
        richard.evans@blueallegro.net Richard Evans added a comment -

        Any update on this? I have migrated to Eclipse Mars (4.5) and cannot use the LDAP perspective.

        Show
        richard.evans@blueallegro.net Richard Evans added a comment - Any update on this? I have migrated to Eclipse Mars (4.5) and cannot use the LDAP perspective.
        Hide
        pavel.horal Pavel Horal added a comment -

        How to make things work till a proper fix in place:

        • delete slf4j.api_1.7.10.jar and slf4j-log4j12-1.7.10.jar from eclipse/plugins
        • update slf4j dependency to 1.7.2 in the following files (under eclipse/plugins):
          • org.apache.directory.api.asn1.ber_1.0.0.M30.jar
          • org.apache.directory.api.ldap.extras.aci_1.0.0.M30.jar
          • org.apache.directory.api.ldap.schema_1.0.0.M30.jar
          • org.apache.mina.core_2.0.9.jar

        Updating dependency means unzipping contents of the JAR, opening META-INF/MANIFEST.MF, updating version in Import-Package and repackaging the manifest back to the JAR.

        Show
        pavel.horal Pavel Horal added a comment - How to make things work till a proper fix in place: delete slf4j.api_1.7.10.jar and slf4j-log4j12-1.7.10.jar from eclipse/plugins update slf4j dependency to 1.7.2 in the following files (under eclipse/plugins ): org.apache.directory.api.asn1.ber_1.0.0.M30.jar org.apache.directory.api.ldap.extras.aci_1.0.0.M30.jar org.apache.directory.api.ldap.schema_1.0.0.M30.jar org.apache.mina.core_2.0.9.jar Updating dependency means unzipping contents of the JAR, opening META-INF/MANIFEST.MF , updating version in Import-Package and repackaging the manifest back to the JAR.
        Hide
        richard.evans@blueallegro.net Richard Evans added a comment -

        I'm running Eclipse Mars update 1. I tried the steps above but no success - I could not see LDAP in the perspective list. I also found that I did not have slf4j-log4j12-1.7.10.jar in the plugins directory. The API file slf4j.api_1.7.10.jar was there.

        Show
        richard.evans@blueallegro.net Richard Evans added a comment - I'm running Eclipse Mars update 1. I tried the steps above but no success - I could not see LDAP in the perspective list. I also found that I did not have slf4j-log4j12-1.7.10.jar in the plugins directory. The API file slf4j.api_1.7.10.jar was there.
        Hide
        seelmann Stefan Seelmann added a comment -

        Emmanuel Lecharny Any chance to get a Mina 2.0.10 release (tell if I can help)? Or should I investigate to find another solution (probably downgrade to slf4j 1.7.2 would work)?

        Show
        seelmann Stefan Seelmann added a comment - Emmanuel Lecharny Any chance to get a Mina 2.0.10 release (tell if I can help)? Or should I investigate to find another solution (probably downgrade to slf4j 1.7.2 would work)?
        Hide
        elecharny Emmanuel Lecharny added a comment -

        I still have to get it done :/ My bad.

        I think we have pretty much it ready to be released. I'll check with Jeff (the MINA chairman atm)

        I'll keep you posted

        Show
        elecharny Emmanuel Lecharny added a comment - I still have to get it done :/ My bad. I think we have pretty much it ready to be released. I'll check with Jeff (the MINA chairman atm) I'll keep you posted
        Hide
        elecharny Emmanuel Lecharny added a comment -

        FTR, I have started the release of MINA 2.0.10, the vote will be issued tomorrow.

        Show
        elecharny Emmanuel Lecharny added a comment - FTR, I have started the release of MINA 2.0.10, the vote will be issued tomorrow.
        Hide
        elecharny Emmanuel Lecharny added a comment -

        MINA 2.0.10 is out.

        Show
        elecharny Emmanuel Lecharny added a comment - MINA 2.0.10 is out.
        Hide
        seelmann Stefan Seelmann added a comment -

        Fixed here: http://svn.apache.org/viewvc?rev=1721235&view=rev

        Many thanks Emmanuel for releaseing Mina, API, and ApacheDS!

        Show
        seelmann Stefan Seelmann added a comment - Fixed here: http://svn.apache.org/viewvc?rev=1721235&view=rev Many thanks Emmanuel for releaseing Mina, API, and ApacheDS!

          People

          • Assignee:
            Unassigned
            Reporter:
            rombert Robert Munteanu
          • Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development