Umgebung

AEM 6.x

Problem

Einige OSGi-Bundles starten nicht auf der AEM-Instanz. Eine Fehlermeldung, ähnlich der untenstehenden, wird angezeigt, wenn Benutzer versuchen, die fehlerhaften Bundles zu starten:

30.12.2016 13:11:44.069 *ERROR* [qtp1529861461-2584] org.apache.felix.http.jetty %bundles.pluginTitle: Cannot start (org.osgi.framework.BundleException: Uses constraint violation. Unable to resolve resource com.adobe.cq.dam.cq-scene7-imaging [com.adobe.cq.dam.cq-scene7-imaging [436](R 436.3)] because it is exposed to package 'javax.activation' from resources org.apache.felix.framework [org.apache.felix.framework [0](R 0)] and org.apache.sling.javax.activation [org.apache.sling.javax.activation [11](R 11.0)] via two dependency chains.

Chain 1:
  com.adobe.cq.dam.cq-scene7-imaging [com.adobe.cq.dam.cq-scene7-imaging [436](R 436.3)]
    import: (osgi.wiring.package=javax.activation)
     |
    export: osgi.wiring.package: javax.activation
  org.apache.felix.framework [org.apache.felix.framework [0](R 0)]

Chain 2:
  com.adobe.cq.dam.cq-scene7-imaging [com.adobe.cq.dam.cq-scene7-imaging [436](R 436.3)]
    import: (osgi.wiring.package=javax.mail)
     |
    export: osgi.wiring.package=javax.mail; uses:=javax.activation
  javax.mail [javax.mail [209](R 209.0)]
    import: (osgi.wiring.package=javax.activation)
     |
    export: osgi.wiring.package: javax.activation
  org.apache.sling.javax.activation [org.apache.sling.javax.activation [11](R 11.0)] Unresolved requirements: [[com.adobe.cq.dam.cq-scene7-imaging [436](R 436.3)] osgi.wiring.package; (osgi.wiring.package=javax.mail)])
org.osgi.framework.BundleException: Uses constraint violation. Unable to resolve resource com.adobe.cq.dam.cq-scene7-imaging [com.adobe.cq.dam.cq-scene7-imaging [436](R 436.3)] because it is exposed to package 'javax.activation' from resources org.apache.felix.framework [org.apache.felix.framework [0](R 0)] and org.apache.sling.javax.activation [org.apache.sling.javax.activation [11](R 11.0)] via two dependency chains.

Chain 1:
  com.adobe.cq.dam.cq-scene7-imaging [com.adobe.cq.dam.cq-scene7-imaging [436](R 436.3)]
    import: (osgi.wiring.package=javax.activation)
     |
    export: osgi.wiring.package: javax.activation
  org.apache.felix.framework [org.apache.felix.framework [0](R 0)]

Chain 2:
  com.adobe.cq.dam.cq-scene7-imaging [com.adobe.cq.dam.cq-scene7-imaging [436](R 436.3)]
    import: (osgi.wiring.package=javax.mail)
     |
    export: osgi.wiring.package=javax.mail; uses:=javax.activation
  javax.mail [javax.mail [209](R 209.0)]
    import: (osgi.wiring.package=javax.activation)
     |
    export: osgi.wiring.package: javax.activation
  org.apache.sling.javax.activation [org.apache.sling.javax.activation [11](R 11.0)] Unresolved requirements: [[com.adobe.cq.dam.cq-scene7-imaging [436](R 436.3)] osgi.wiring.package; (osgi.wiring.package=javax.mail)]
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4111)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2117)
        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984)
        at org.apache.felix.webconsole.internal.core.BundlesServlet.doPost(BundlesServlet.java:365)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:644)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
        at org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:567)
        at org.apache.felix.webconsole.internal.servlet.OsgiManager$3.run(OsgiManager.java:465)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:461)
        at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:85)
        at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:79)
        at com.adobe.granite.license.impl.LicenseCheckFilter.doFilter(LicenseCheckFilter.java:308)
        at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
        at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)
        at org.apache.felix.http.sslfilter.internal.SslFilter.doFilter(SslFilter.java:89)
        at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
        at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)
        at org.apache.sling.security.impl.ReferrerFilter.doFilter(ReferrerFilter.java:290)
        at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
        at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)
        at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:129)
        at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
        at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)
        at org.apache.sling.featureflags.impl.FeatureManager.doFilter(FeatureManager.java:116)
        at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
        at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)
        at org.apache.sling.engine.impl.log.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:75)
        at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
        at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)
        at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:124)
        at org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:61)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)

Ursache

Es gibt Duplikate von OSGi-Exporten desselben Java-Pakets mit überlappenden Versionen, wie im Fehler beschrieben.

Lösung

Lesen Sie die Protokollmeldung sorgfältig, die Ihnen genau anzeigt, welche OSGi-Bundles das gleiche Java-Paket exportieren, wie unten dargestellt:

„Es ist dem Paket 'javax.activation' aus Ressourcen org.apache.felix.framework [org.apache.felix.framework [0](R 0)] und org.apache.sling.javax.activation [org.apache.sling.javax.activation [11](R 11.0)] über zwei Abhängigkeitsketten ausgesetzt.“

Es gibt also zwei Bundles, die javax.activation exportieren:

  1. org.apache.felix.framework - Apache Felix Framework Bundle
  2. org.apache.sling.javax.activation- Bereitstellen von Sling-Bundle

Weitere Recherchen zeigen, dass das Sling-Bundle zu AEM gehört und der Framework-Export von javax.activation ungültig ist. Framework-Bundle-Exporte können aus den folgenden Quellen stammen:

  1. JVM-Parameter für Bootdelegation -Dorg.osgi.framework.bootdelegation
  2. Framework-Erweiterungs-Bundle
  3. Conf-/Sling-Eigenschaften von AEM org.osgi.framework.system.capabilities.extra und org.osgi.framework.bootdelegation-Konfigurationen

Die Änderung einer dieser Konfigurationen, um einen Export für javax.activation hinzuzufügen, verursacht das Problem.

Dieses Werk unterliegt den Bedingungen der Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.  Twitter™- und Facebook-Beiträge fallen nicht unter die Bedingungen der Creative Commons-Lizenz.

Rechtliche Hinweise   |   Online-Datenschutzrichtlinie