Karaf
  1. Karaf
  2. KARAF-1127

Boot features failed to startup when karaf started from directory with closing brace; logs also unavailable

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.4, 2.2.5
    • Fix Version/s: 2.2.6, 3.0.0
    • Component/s: karaf-core
    • Labels:
      None
    • Environment:

      Description

      Product started but logs contains only following record:
      26.12.2011 17:10:32 org.apache.karaf.main.SimpleFileLock lock
      INFO: locking

      I tried to debug and found that property org.ops4j.pax.url.mvn.defaultRepositories is null at
      org.ops4j.pax.swissbox.property.BundleContextPropertyResolver.findProperty(String)

      Console output:
      [Thread-6] ERROR org.apache.karaf.features.internal.FeaturesServiceImpl - Error installing boot feature config: feature not found
      [Thread-6] ERROR org.apache.karaf.features.internal.FeaturesServiceImpl - Error installing boot feature ssh: feature not found
      [Thread-6] ERROR org.apache.karaf.features.internal.FeaturesServiceImpl - Error installing boot feature management: feature not found
      [Thread-6] ERROR org.apache.karaf.features.internal.FeaturesServiceImpl - Error installing boot feature kar: feature not found

        Issue Links

          Activity

          Hide
          Jean-Baptiste Onofré added a comment -

          I raised the Jira at Felix and provided a patch.

          Now, we have to wait a new fileinstall release.

          Show
          Jean-Baptiste Onofré added a comment - I raised the Jira at Felix and provided a patch. Now, we have to wait a new fileinstall release.
          Hide
          Jean-Baptiste Onofré added a comment -

          fileinstall interprets the () as a filter:

          org.osgi.framework.InvalidSyntaxException: Unknown operator:
          at org.apache.felix.framework.FilterImpl.<init>(FilterImpl.java:51)
          at org.apache.felix.framework.BundleContextImpl.createFilter(BundleContextImpl.java:132)
          at org.apache.felix.cm.impl.ConfigurationManager.listConfigurations(ConfigurationManager.java:554)
          at org.apache.felix.cm.impl.ConfigurationAdminImpl.listConfigurations(ConfigurationAdminImpl.java:169)
          at org.apache.felix.fileinstall.internal.ConfigInstaller.findExistingConfiguration(ConfigInstaller.java:319)
          at org.apache.felix.fileinstall.internal.ConfigInstaller.getConfiguration(ConfigInstaller.java:293)
          at org.apache.felix.fileinstall.internal.ConfigInstaller.setConfig(ConfigInstaller.java:218)
          at org.apache.felix.fileinstall.internal.ConfigInstaller.install(ConfigInstaller.java:82)
          at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:888)
          at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:816)
          at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:454)
          at org.apache.felix.fileinstall.internal.DirectoryWatcher.start(DirectoryWatcher.java:205)
          at org.apache.felix.fileinstall.internal.FileInstall.updated(FileInstall.java:227)
          at org.apache.felix.fileinstall.internal.FileInstall.start(FileInstall.java:131)
          at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:641)
          at org.apache.felix.framework.Felix.doActivateBundle(Felix.java:2044)
          at org.apache.felix.framework.Felix$4.call(Felix.java:1969)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
          at java.util.concurrent.FutureTask.run(FutureTask.java:138)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:680)

          So, the problem is really on fileinstall which should escape the braces.

          Show
          Jean-Baptiste Onofré added a comment - fileinstall interprets the () as a filter: org.osgi.framework.InvalidSyntaxException: Unknown operator: at org.apache.felix.framework.FilterImpl.<init>(FilterImpl.java:51) at org.apache.felix.framework.BundleContextImpl.createFilter(BundleContextImpl.java:132) at org.apache.felix.cm.impl.ConfigurationManager.listConfigurations(ConfigurationManager.java:554) at org.apache.felix.cm.impl.ConfigurationAdminImpl.listConfigurations(ConfigurationAdminImpl.java:169) at org.apache.felix.fileinstall.internal.ConfigInstaller.findExistingConfiguration(ConfigInstaller.java:319) at org.apache.felix.fileinstall.internal.ConfigInstaller.getConfiguration(ConfigInstaller.java:293) at org.apache.felix.fileinstall.internal.ConfigInstaller.setConfig(ConfigInstaller.java:218) at org.apache.felix.fileinstall.internal.ConfigInstaller.install(ConfigInstaller.java:82) at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:888) at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:816) at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:454) at org.apache.felix.fileinstall.internal.DirectoryWatcher.start(DirectoryWatcher.java:205) at org.apache.felix.fileinstall.internal.FileInstall.updated(FileInstall.java:227) at org.apache.felix.fileinstall.internal.FileInstall.start(FileInstall.java:131) at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:641) at org.apache.felix.framework.Felix.doActivateBundle(Felix.java:2044) at org.apache.felix.framework.Felix$4.call(Felix.java:1969) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:680) So, the problem is really on fileinstall which should escape the braces.
          Hide
          Jean-Baptiste Onofré added a comment -

          The issue doesn't look to come from Felix fileinstall as if I put braces in the deploy dir path, fileinstall is able to deploy the bundle jar.

          So, I think it's linked to the way that we load the config.properties in the Karaf Main.

          Show
          Jean-Baptiste Onofré added a comment - The issue doesn't look to come from Felix fileinstall as if I put braces in the deploy dir path, fileinstall is able to deploy the bundle jar. So, I think it's linked to the way that we load the config.properties in the Karaf Main.
          Hide
          Jean-Baptiste Onofré added a comment -

          Interesting:

          I have installed Karaf in a folder with a space/braces.

          In the etc/config.properties file, I define another path (without braces) in felix.fileinstall.dir:

          felix.fileinstall.dir=/tmp/etc

          And like this, all is working fine.

          I'm digging

          Show
          Jean-Baptiste Onofré added a comment - Interesting: I have installed Karaf in a folder with a space/braces. In the etc/config.properties file, I define another path (without braces) in felix.fileinstall.dir: felix.fileinstall.dir=/tmp/etc And like this, all is working fine. I'm digging
          Hide
          Jean-Baptiste Onofré added a comment -

          OK, I think I understand the issue:

          karaf@root> config:list
          ----------------------------------------------------------------
          Pid: org.apache.karaf.shell
          BundleLocation: mvn:org.apache.karaf.shell/org.apache.karaf.shell.ssh/2.2.6-SNAPSHOT
          Properties:
          service.pid = org.apache.karaf.shell
          sshPort = 8101
          hostKey = /home/jbonofre/workspace/karaf/karaf/assemblies/apache-karaf/target/karaf (test)/etc/host.key
          sshRealm = karaf
          sshHost = 0.0.0.0
          org.apache.karaf.features.configKey = org.apache.karaf.shell

          We have only one PID registered in ConfigAdmin

          It's the main cause of the issue: lot of configuration is missing.

          Show
          Jean-Baptiste Onofré added a comment - OK, I think I understand the issue: karaf@root> config:list ---------------------------------------------------------------- Pid: org.apache.karaf.shell BundleLocation: mvn:org.apache.karaf.shell/org.apache.karaf.shell.ssh/2.2.6-SNAPSHOT Properties: service.pid = org.apache.karaf.shell sshPort = 8101 hostKey = /home/jbonofre/workspace/karaf/karaf/assemblies/apache-karaf/target/karaf (test)/etc/host.key sshRealm = karaf sshHost = 0.0.0.0 org.apache.karaf.features.configKey = org.apache.karaf.shell We have only one PID registered in ConfigAdmin It's the main cause of the issue: lot of configuration is missing.
          Hide
          Jean-Baptiste Onofré added a comment -

          No, admin is OK (just have to remove the instances directory after "rename" the directory).

          I'm investigating around.

          Show
          Jean-Baptiste Onofré added a comment - No, admin is OK (just have to remove the instances directory after "rename" the directory). I'm investigating around.
          Hide
          Jean-Baptiste Onofré added a comment -

          The instances.properties is not updated correctly, and admin:list displays Error as instance state when using KARAF_HOME containing space.

          Show
          Jean-Baptiste Onofré added a comment - The instances.properties is not updated correctly, and admin:list displays Error as instance state when using KARAF_HOME containing space.
          Hide
          Jean-Baptiste Onofré added a comment -

          OK, I saw an issue on Linux also:

          log:display doesn't display anything

          and

          log:set DEBUG

          raises a NullPointerException.

          Show
          Jean-Baptiste Onofré added a comment - OK, I saw an issue on Linux also: log:display doesn't display anything and log:set DEBUG raises a NullPointerException.
          Hide
          Jean-Baptiste Onofré added a comment -

          I tested with both Felix and Equinox frameworks, using the following path for Karaf:

          /home/jbonofre/karaf (test)/

          so including space and braces.

          I didn't reproduce the issue on Ubuntu and Fedora using Sun JDI 1.6.

          I'm going to test with Windows VM to reproduce.

          Show
          Jean-Baptiste Onofré added a comment - I tested with both Felix and Equinox frameworks, using the following path for Karaf: /home/jbonofre/karaf (test)/ so including space and braces. I didn't reproduce the issue on Ubuntu and Fedora using Sun JDI 1.6. I'm going to test with Windows VM to reproduce.
          Hide
          Jean-Baptiste Onofré added a comment -

          I will fix that for Karaf 2.2.6.

          Show
          Jean-Baptiste Onofré added a comment - I will fix that for Karaf 2.2.6.
          Hide
          Saphen Qiu added a comment -

          I meet the error when the installation path contains "()", I am using karaf 2.2.1, can somebody please help to fix the issue and so that we can update karaf accordingly?

          Show
          Saphen Qiu added a comment - I meet the error when the installation path contains "()", I am using karaf 2.2.1, can somebody please help to fix the issue and so that we can update karaf accordingly?
          Hide
          Jean-Baptiste Onofré added a comment -

          Thanks for the detailed explanation Alexey, I will take a look later today.

          Show
          Jean-Baptiste Onofré added a comment - Thanks for the detailed explanation Alexey, I will take a look later today.

            People

            • Assignee:
              Jean-Baptiste Onofré
              Reporter:
              Alexey Markevich
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development