Hi,

some third party bundle that is part of my runtime depends on
"org.eclipse.equinox.common".

I am using Karaf 4.2.7

If the Equinox framework is used I can install and start
"org.eclipse.equinox.common".

# Install requirement
bundle:install mvn:org.eclipse.platform/org.eclipse.equinox.supplement/1.9.0
# Install and start Equinox Common
bundle:install -s mvn:org.eclipse.platform/org.eclipse.equinox.common/3.10.400

If the same commands are entered using Felix framework (so an
unmodified Karaf configuration) the Activator of Equinox Common fails.

===
13:39:13.316 ERROR [Karaf local console user karaf] Exception caught
while executing command
org.apache.karaf.shell.support.MultiException: Error installing bundles:
        Unable to start bundle
mvn:org.eclipse.platform/org.eclipse.equinox.common/3.10.400:
org.osgi.framework.BundleException: Activator start error in bundle
org.eclipse.equinox.common [45].
        at 
org.apache.karaf.shell.support.MultiException.throwIf(MultiException.java:61)
~[?:?]
        at org.apache.karaf.bundle.command.Install.execute(Install.java:131)
~[?:?]
        at 
org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
~[?:?]
        at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
~[?:?]
        at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
~[?:?]
        at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599)
~[?:?]
        at 
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526)
~[?:?]
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415)
~[?:?]
        at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) ~[?:?]
        at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) ~[?:?]
        at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
~[?:1.8.0_202]
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
~[?:1.8.0_202]
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
~[?:1.8.0_202]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_202]
        Suppressed: java.lang.Exception: Unable to start bundle
mvn:org.eclipse.platform/org.eclipse.equinox.common/3.10.400:
org.osgi.framework.BundleException: Activator start error in bundle
org.eclipse.equinox.common [45].
                at
org.apache.karaf.bundle.command.Install.execute(Install.java:117)
~[?:?]
                at
org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
~[?:?]
                at
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
~[?:?]
                at
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
~[?:?]
                at
org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599)
~[?:?]
                at
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526)
~[?:?]
                at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415) ~[?:?]
                at
org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) ~[?:?]
                at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) ~[?:?]
                at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) ~[?:?]
                at
java.util.concurrent.FutureTask.run(FutureTask.java:266)
~[?:1.8.0_202]
                at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
~[?:1.8.0_202]
                at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
~[?:1.8.0_202]
                at java.lang.Thread.run(Thread.java:748) [?:1.8.0_202]
        Caused by: org.osgi.framework.BundleException: Activator start
error in bundle org.eclipse.equinox.common [45].
                at
org.apache.felix.framework.Felix.activateBundle(Felix.java:2290)
~[?:?]
                at
org.apache.felix.framework.Felix.startBundle(Felix.java:2146) ~[?:?]
                at
org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
~[?:?]
                at
org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984)
~[?:?]
                at
org.apache.karaf.bundle.command.Install.execute(Install.java:115)
~[?:?]
                ... 13 more
        Caused by: java.lang.NoClassDefFoundError: org/osgi/service/log/Logger
                at java.lang.ClassLoader.defineClass1(Native Method)
~[?:1.8.0_202]
                at
java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[?:1.8.0_202]
                at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2410)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2194)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1607)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
~[?:?]
                at
java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_202]
                at java.lang.ClassLoader.defineClass1(Native Method)
~[?:1.8.0_202]
                at
java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[?:1.8.0_202]
                at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2410)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2194)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1607)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
~[?:?]
                at
java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_202]
                at
org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1414)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1660)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1590)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
~[?:?]
                at
java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_202]
                at
org.eclipse.core.internal.runtime.Activator.getPlatformWriter(Activator.java:95)
~[?:?]
                at
org.eclipse.core.internal.runtime.Activator.start(Activator.java:83)
~[?:?]
                at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:697)
~[?:?]
                at
org.apache.felix.framework.Felix.activateBundle(Felix.java:2240)
~[?:?]
                at
org.apache.felix.framework.Felix.startBundle(Felix.java:2146) ~[?:?]
                at
org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
~[?:?]
                at
org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984)
~[?:?]
                at
org.apache.karaf.bundle.command.Install.execute(Install.java:115)
~[?:?]
                ... 13 more
        Caused by: java.lang.ClassNotFoundException:
org.osgi.service.log.Logger not found by
org.ops4j.pax.logging.pax-logging-api [6]
                at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1639)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
~[?:?]
                at
java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_202]
                at
org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1414)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1660)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1590)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
~[?:?]
                at
java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_202]
                at java.lang.ClassLoader.defineClass1(Native Method)
~[?:1.8.0_202]
                at
java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[?:1.8.0_202]
                at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2410)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2194)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1607)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
~[?:?]
                at
java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_202]
                at java.lang.ClassLoader.defineClass1(Native Method)
~[?:1.8.0_202]
                at
java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[?:1.8.0_202]
                at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2410)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2194)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1607)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
~[?:?]
                at
java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_202]
                at
org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1414)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1660)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1590)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
~[?:?]
                at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
~[?:?]
                at
java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_202]
                at
org.eclipse.core.internal.runtime.Activator.getPlatformWriter(Activator.java:95)
~[?:?]
                at
org.eclipse.core.internal.runtime.Activator.start(Activator.java:83)
~[?:?]
                at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:697)
~[?:?]
                at
org.apache.felix.framework.Felix.activateBundle(Felix.java:2240)
~[?:?]
                at
org.apache.felix.framework.Felix.startBundle(Felix.java:2146) ~[?:?]
                at
org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
~[?:?]
                at
org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984)
~[?:?]
                at
org.apache.karaf.bundle.command.Install.execute(Install.java:115)
~[?:?]
                ... 13 more
===


If we look at the exports for the relevant package on Equinox:

karaf@root()> package:exports -p org.osgi.service.log
Package Name         │ Version │ ID │ Bundle Name
─────────────────────┼─────────┼────┼──────────────────────────────────────
org.osgi.service.log │ 1.3.0   │ 6  │ org.ops4j.pax.logging.pax-logging-api
org.osgi.service.log │ 1.3.0   │ 0  │ org.eclipse.osgi

on Felix

karaf@root()> package:exports -p org.osgi.service.log
Package Name         │ Version │ ID │ Bundle Name
─────────────────────┼─────────┼────┼──────────────────────────────────────
org.osgi.service.log │ 1.3.0   │ 6  │ org.ops4j.pax.logging.pax-logging-api


To be more precise, the export package header of the Pax Logging API looks like:

org.osgi.service.log;uses:=org.osgi.framework;version=1.3

So, it needs to fail as long as Apache Felix Core does not export this
package itself.
Correct?

How to fix?

Best regards,
Markus

Reply via email to