Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0.RC1
    • Fix Version/s: 3.0.0
    • Component/s: None
    • Labels:
      None

      Description

      Karaf 3.0.0.RC1 comes with Equinox 3.8.0 which provides org.osgi.framework 1.7.

      This does not match the OSGi system packages declared in etc/config.properties, including org.osgi.framework 1.6.

      At runtime, I'm getting strange stacktraces like the following which I suspect to be due to this conflict:

      java.lang.NoSuchMethodError: org.osgi.framework.Version.toString0()Ljava/lang/String;
      at org.osgi.framework.VersionRange.toString(VersionRange.java:393)[osgi-3.8.0.v20120529-1548.jar:]
      at java.lang.String.valueOf(String.java:2854)[:1.7.0_17]
      at java.lang.StringBuffer.append(StringBuffer.java:232)[:1.7.0_17]
      at org.eclipse.osgi.internal.resolver.ImportPackageSpecificationImpl.toString(ImportPackageSpecificationImpl.java:212)
      at org.eclipse.osgi.internal.module.ResolverImpl.resolveBundle(ResolverImpl.java:1373)
      at org.eclipse.osgi.internal.module.ResolverImpl.resolveBundles0(ResolverImpl.java:783)
      at org.eclipse.osgi.internal.module.ResolverImpl.resolveBundles(ResolverImpl.java:653)
      at org.eclipse.osgi.internal.module.ResolverImpl.resolve(ResolverImpl.java:487)
      at org.eclipse.osgi.internal.resolver.StateImpl.resolve(StateImpl.java:481)
      at org.eclipse.osgi.internal.resolver.StateImpl.resolve(StateImpl.java:557)
      at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.doResolveBundles(PackageAdminImpl.java:249)
      at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.resolveBundles(PackageAdminImpl.java:192)
      at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:322)
      at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300)
      at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:292)
      at org.apache.karaf.bundle.command.Start.executeOnBundle(Start.java:27)
      at org.apache.karaf.bundle.command.BundlesCommandWithConfirmation.doExecute(BundlesCommandWithConfirmation.java:53)
      at org.apache.karaf.bundle.command.BundlesCommand.doExecute(BundlesCommand.java:50)
      at org.apache.karaf.bundle.command.BundlesCommandWithConfirmation.doExecute(BundlesCommandWithConfirmation.java:41)
      at org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)
      at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:39)
      at org.apache.karaf.shell.commands.basic.AbstractCommand.execute(AbstractCommand.java:33)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_17]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_17]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_17]
      at java.lang.reflect.Method.invoke(Method.java:601)[:1.7.0_17]
      at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:54)
      at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:119)
      at org.apache.karaf.shell.console.commands.$BlueprintCommand1800385139.execute(Unknown Source)
      at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)
      at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)
      at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)
      at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
      at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
      at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
      at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
      at org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:182)
      at java.lang.Thread.run(Thread.java:722)[:1.7.0_17]
      at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.doRun(ConsoleFactoryService.java:102)[48:org.apache.karaf.shell.console:3.0.0.RC1]
      at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3$1.run(ConsoleFactoryService.java:93)
      at java.security.AccessController.doPrivileged(Native Method)[:1.7.0_17]
      at javax.security.auth.Subject.doAs(Subject.java:356)[:1.7.0_17]
      at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.run(ConsoleFactoryService.java:91)[48:org.apache.karaf.shell.console:3.0.0.RC1]

      To reproduce:

      • Unpack a Karaf distro.
      • Set karaf.framework=equinox in etc/config.properties
      • Start Karaf.
      • Install a bundle with unsatisfied imports, e.g. install mvn:org.ops4j.pax.exam/pax-exam/3.0.1
      • Start the bundle.

        Issue Links

          Activity

          Hide
          jbonofre Jean-Baptiste Onofré added a comment -

          I'm going to take a look.

          Show
          jbonofre Jean-Baptiste Onofré added a comment - I'm going to take a look.
          Hide
          jbonofre Jean-Baptiste Onofré added a comment -

          I reproduce with avro-ipc ServiceMix bundles for instance (which requires avro).

          Show
          jbonofre Jean-Baptiste Onofré added a comment - I reproduce with avro-ipc ServiceMix bundles for instance (which requires avro).
          Show
          jbonofre Jean-Baptiste Onofré added a comment - Fixed on trunk: http://svn.apache.org/viewvc?view=revision&revision=1459449
          Hide
          tnarake Timo Naroska added a comment -

          I'm afraid the new package versions are not compatible with Felix 4.0.3. Should update to Felix 4.2.0 which uses OSGi R5 packages. See FELIX-3504

          Show
          tnarake Timo Naroska added a comment - I'm afraid the new package versions are not compatible with Felix 4.0.3. Should update to Felix 4.2.0 which uses OSGi R5 packages. See FELIX-3504
          Hide
          jbonofre Jean-Baptiste Onofré added a comment -

          It's not a problem as we already use this configuration in Karaf 2.3.x.

          Show
          jbonofre Jean-Baptiste Onofré added a comment - It's not a problem as we already use this configuration in Karaf 2.3.x.
          Hide
          gurkerl gurkerl added a comment -

          Hi, just tried the actual config.properties but with no success.
          I have tried a new version - org.eclipse.osgi_3.8.2.v20130124-134944.jar as well but I´m getting the same error every time I try to start the bundle.

          Error executing command: org.osgi.framework.Version.toString0()Ljava/lang/String;

          karaf.framework.equinox=mvn\:org.eclipse/osgi/3.8.2.v20130124-134944

          Maybe I`m doing something wrong??? Can someone list the steps to resolve this issue?

          Thanks

          Show
          gurkerl gurkerl added a comment - Hi, just tried the actual config.properties but with no success. I have tried a new version - org.eclipse.osgi_3.8.2.v20130124-134944.jar as well but I´m getting the same error every time I try to start the bundle. Error executing command: org.osgi.framework.Version.toString0()Ljava/lang/String; karaf.framework.equinox=mvn\:org.eclipse/osgi/3.8.2.v20130124-134944 Maybe I`m doing something wrong??? Can someone list the steps to resolve this issue? Thanks
          Hide
          astahlhofen Andreas Stahlhofen added a comment -

          Hi,

          same position here. I've tried to install the bundle commons-beanutils with following command:

          install -s mvn:commons-beanutils/commons-beanutils/1.8.3

          The following error occured:
          Error executing command: org.osgi.framework.Version.toString0()Ljava/lang/String;

          Full log shows the same listed in the bug description:
          2013-04-03 07:50:20,889 | DEBUG | Event Dispatcher | beanutils | 77 - org.apache.commons.beanutils - 1.8.3 | BundleEvent INSTALLED - org.apache.commons.beanutils
          2013-04-03 07:50:20,896 | INFO | Local user karaf | ShellUtil | 48 - org.apache.karaf.shell.console - 3.0.0.RC1 | Exception caught while executing command
          java.lang.NoSuchMethodError: org.osgi.framework.Version.toString0()Ljava/lang/String;
          at org.osgi.framework.VersionRange.toString(VersionRange.java:387)[osgi-3.8.0.v20120529-1548.jar:]
          at java.lang.String.valueOf(String.java:2854)[:1.7.0_17]
          at java.lang.StringBuffer.append(StringBuffer.java:232)[:1.7.0_17]
          at org.eclipse.osgi.internal.resolver.ImportPackageSpecificationImpl.toString(ImportPackageSpecificationImpl.java:212)
          at org.eclipse.osgi.internal.module.ResolverImpl.resolveBundle(ResolverImpl.java:1373)
          at org.eclipse.osgi.internal.module.ResolverImpl.resolveBundles0(ResolverImpl.java:783)
          at org.eclipse.osgi.internal.module.ResolverImpl.resolveBundles(ResolverImpl.java:653)
          at org.eclipse.osgi.internal.module.ResolverImpl.resolve(ResolverImpl.java:487)
          at org.eclipse.osgi.internal.resolver.StateImpl.resolve(StateImpl.java:481)
          at org.eclipse.osgi.internal.resolver.StateImpl.resolve(StateImpl.java:557)
          at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.doResolveBundles(PackageAdminImpl.java:249)
          at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.resolveBundles(PackageAdminImpl.java:192)
          at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:322)
          at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300)
          at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:292)
          at org.apache.karaf.bundle.command.Install.doExecute(Install.java:51)
          at org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)
          at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:39)
          at org.apache.karaf.shell.commands.basic.AbstractCommand.execute(AbstractCommand.java:33)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_17]
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_17]
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_17]
          at java.lang.reflect.Method.invoke(Method.java:601)[:1.7.0_17]
          at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:54)
          at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:119)
          at org.apache.karaf.shell.console.commands.$BlueprintCommand105667283.execute(Unknown Source)
          at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)
          at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)
          at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)
          at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
          at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
          at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
          at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
          at org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:182)
          at java.lang.Thread.run(Thread.java:722)[:1.7.0_17]
          at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.doRun(ConsoleFactoryService.java:102)[48:org.apache.karaf.shell.console:3.0.0.RC1]
          at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3$1.run(ConsoleFactoryService.java:93)
          at java.security.AccessController.doPrivileged(Native Method)[:1.7.0_17]
          at javax.security.auth.Subject.doAs(Subject.java:356)[:1.7.0_17]
          at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.run(ConsoleFactoryService.java:91)[48:org.apache.karaf.shell.console:3.0.0.RC1]

          I'm using version 3.0.0.RC1 of karaf. Also tried a manually build 3.0.0-SNAPSHOT distribution from the svn-repository, but the same error occurred.
          URL: http://svn.apache.org/repos/asf/karaf/trunk
          Repository Root: http://svn.apache.org/repos/asf
          Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68
          Revision: 1463833
          Node Kind: directory
          Schedule: normal
          Last Changed Author: jbonofre
          Last Changed Rev: 1462080
          Last Changed Date: 2013-03-28 14:09:11 +0100 (Do, 28 Mär 2013)

          I'm also interested to solve this problem, so some help or guiding would be nice.

          Thanks and best regards.
          Andreas

          Show
          astahlhofen Andreas Stahlhofen added a comment - Hi, same position here. I've tried to install the bundle commons-beanutils with following command: install -s mvn:commons-beanutils/commons-beanutils/1.8.3 The following error occured: Error executing command: org.osgi.framework.Version.toString0()Ljava/lang/String; Full log shows the same listed in the bug description: 2013-04-03 07:50:20,889 | DEBUG | Event Dispatcher | beanutils | 77 - org.apache.commons.beanutils - 1.8.3 | BundleEvent INSTALLED - org.apache.commons.beanutils 2013-04-03 07:50:20,896 | INFO | Local user karaf | ShellUtil | 48 - org.apache.karaf.shell.console - 3.0.0.RC1 | Exception caught while executing command java.lang.NoSuchMethodError: org.osgi.framework.Version.toString0()Ljava/lang/String; at org.osgi.framework.VersionRange.toString(VersionRange.java:387) [osgi-3.8.0.v20120529-1548.jar:] at java.lang.String.valueOf(String.java:2854) [:1.7.0_17] at java.lang.StringBuffer.append(StringBuffer.java:232) [:1.7.0_17] at org.eclipse.osgi.internal.resolver.ImportPackageSpecificationImpl.toString(ImportPackageSpecificationImpl.java:212) at org.eclipse.osgi.internal.module.ResolverImpl.resolveBundle(ResolverImpl.java:1373) at org.eclipse.osgi.internal.module.ResolverImpl.resolveBundles0(ResolverImpl.java:783) at org.eclipse.osgi.internal.module.ResolverImpl.resolveBundles(ResolverImpl.java:653) at org.eclipse.osgi.internal.module.ResolverImpl.resolve(ResolverImpl.java:487) at org.eclipse.osgi.internal.resolver.StateImpl.resolve(StateImpl.java:481) at org.eclipse.osgi.internal.resolver.StateImpl.resolve(StateImpl.java:557) at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.doResolveBundles(PackageAdminImpl.java:249) at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.resolveBundles(PackageAdminImpl.java:192) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:322) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:292) at org.apache.karaf.bundle.command.Install.doExecute(Install.java:51) at org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33) at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:39) at org.apache.karaf.shell.commands.basic.AbstractCommand.execute(AbstractCommand.java:33) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.7.0_17] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [:1.7.0_17] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [:1.7.0_17] at java.lang.reflect.Method.invoke(Method.java:601) [:1.7.0_17] at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:54) at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:119) at org.apache.karaf.shell.console.commands.$BlueprintCommand105667283.execute(Unknown Source) at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78) at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477) at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403) at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108) at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183) at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120) at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89) at org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:182) at java.lang.Thread.run(Thread.java:722) [:1.7.0_17] at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.doRun(ConsoleFactoryService.java:102) [48:org.apache.karaf.shell.console:3.0.0.RC1] at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3$1.run(ConsoleFactoryService.java:93) at java.security.AccessController.doPrivileged(Native Method) [:1.7.0_17] at javax.security.auth.Subject.doAs(Subject.java:356) [:1.7.0_17] at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.run(ConsoleFactoryService.java:91) [48:org.apache.karaf.shell.console:3.0.0.RC1] I'm using version 3.0.0.RC1 of karaf. Also tried a manually build 3.0.0-SNAPSHOT distribution from the svn-repository, but the same error occurred. URL: http://svn.apache.org/repos/asf/karaf/trunk Repository Root: http://svn.apache.org/repos/asf Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68 Revision: 1463833 Node Kind: directory Schedule: normal Last Changed Author: jbonofre Last Changed Rev: 1462080 Last Changed Date: 2013-03-28 14:09:11 +0100 (Do, 28 Mär 2013) I'm also interested to solve this problem, so some help or guiding would be nice. Thanks and best regards. Andreas
          Hide
          jbonofre Jean-Baptiste Onofré added a comment -

          OK, I got it: the problem only occurs on the first start command:

          karaf@root()> bundle:install mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.avro-ipc/1.7.3_1
          Bundle ID: 77
          karaf@root()> bundle:start 77
          Error executing command: org.osgi.framework.Version.toString0()Ljava/lang/String;
          karaf@root()> bundle:start 77
          Error executing command: Error executing command on bundles:
          Unable to execute command on bundle 77: The bundle "org.apache.servicemix.bundles.avro-ipc_1.7.3.1 [77]" could not be resolved

          It may be related to the ShellUtils wrapper.

          Show
          jbonofre Jean-Baptiste Onofré added a comment - OK, I got it: the problem only occurs on the first start command: karaf@root()> bundle:install mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.avro-ipc/1.7.3_1 Bundle ID: 77 karaf@root()> bundle:start 77 Error executing command: org.osgi.framework.Version.toString0()Ljava/lang/String; karaf@root()> bundle:start 77 Error executing command: Error executing command on bundles: Unable to execute command on bundle 77: The bundle "org.apache.servicemix.bundles.avro-ipc_1.7.3.1 [77] " could not be resolved It may be related to the ShellUtils wrapper.
          Hide
          jbonofre Jean-Baptiste Onofré added a comment -

          It's not linked to ShellUtils as I have the same behavior with Karaf MBean.

          Show
          jbonofre Jean-Baptiste Onofré added a comment - It's not linked to ShellUtils as I have the same behavior with Karaf MBean.
          Hide
          jbonofre Jean-Baptiste Onofré added a comment -

          I tested with Equinox 3.8.2 and the behavior is the same.

          Show
          jbonofre Jean-Baptiste Onofré added a comment - I tested with Equinox 3.8.2 and the behavior is the same.
          Hide
          jbonofre Jean-Baptiste Onofré added a comment -

          OK, I understand the issue now:

          • Karaf main depends to OSGi 4.3 (only on trunk, on Karaf 2.x branches, the main depends to felix.framework and equinox directly)
          • Equinox 3.8.0 is the RI for OSGi 5.0

          I gonna upgrade the OSGi Core version (and the system package version to be aligned), it should be better

          Show
          jbonofre Jean-Baptiste Onofré added a comment - OK, I understand the issue now: Karaf main depends to OSGi 4.3 (only on trunk, on Karaf 2.x branches, the main depends to felix.framework and equinox directly) Equinox 3.8.0 is the RI for OSGi 5.0 I gonna upgrade the OSGi Core version (and the system package version to be aligned), it should be better
          Show
          jbonofre Jean-Baptiste Onofré added a comment - http://svn.apache.org/viewvc?view=revision&revision=1477932

            People

            • Assignee:
              jbonofre Jean-Baptiste Onofré
              Reporter:
              hwellmann Harald Wellmann
            • Votes:
              5 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development