Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-5352

KARAF_ETC envvar ignored

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.1.2
    • 4.1.3, 4.2.0.M1
    • karaf
    • None
    • Tested on CentOS 7.x

    Description

      I'm currently working on upgrading the RPM and DEB packaging for Apache Brooklyn. The project uses Karaf and has the following folder structure for the RPM package:

      /-
       +- etc
       |+- brooklyn
       +- opt
       |+- brooklyn-0.12.0-SNAPSHOT
       ||+- bin
       ||+- data
       ||+- deploy
       ||+- lib
       ||+- system
      

      The etc folder is not part of KARAF_HOME but in /etc/brooklyn. I setup my KARAF_ETC to point to this folder, however when I start Karaf, I get the followoing

      Sep 07 15:27:14 br-ovx1by-amp-appl-om8x-empty-t0ww-280 systemd[1]: Started Apache Brooklyn Service.
      Sep 07 15:27:14 br-ovx1by-amp-appl-om8x-empty-t0ww-280 systemd[1]: Starting Apache Brooklyn Service...
      Sep 07 15:27:14 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: JAVA_HOME not set; results may vary
      Sep 07 15:27:14 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: karaf: Ignoring predefined value for KARAF_HOME
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: 15:27:17.085 [pool-1-thread-2] ERROR org.apache.karaf.features.inte
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: java.io.IOException: /opt/brooklyn-0.12.0-SNAPSHOT/etc/0d218152-8d8
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at org.apache.karaf.features.internal.service.RepositoryImpl.load(R
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at org.apache.karaf.features.internal.service.FeaturesServiceImpl.l
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at org.apache.karaf.features.internal.service.FeaturesServiceImpl.a
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at org.apache.karaf.features.internal.service.FeaturesServiceImpl.a
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at org.apache.karaf.features.internal.service.BootFeaturesInstaller
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at org.apache.karaf.features.internal.service.BootFeaturesInstaller
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at org.apache.karaf.features.internal.osgi.Activator.doStart(Activa
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.ja
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.ja
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExec
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExe
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at java.lang.Thread.run(Thread.java:748) [?:?]
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: Caused by: java.io.FileNotFoundException: /opt/brooklyn-0.12.0-SNAP
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at java.io.FileInputStream.open0(Native Method) ~[?:?]
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at java.io.FileInputStream.open(FileInputStream.java:195) ~[?:?]
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at java.io.FileInputStream.<init>(FileInputStream.java:138) ~[?:?]
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at java.io.FileInputStream.<init>(FileInputStream.java:93) ~[?:?]
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConne
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileU
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at java.net.URL.openStream(URL.java:1045) ~[?:?]
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at org.apache.karaf.features.internal.service.RepositoryImpl.load(R
      Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: ... 12 more
      

      As you can see, karaf expect the etc folder to be inside KARAF_HOME even though I specified my KARAF_ETC envvar.

      If I softlink /etc/brooklyn to /opt/brooklyn-0.12.0-SNAPSHOT/etc, it works.

      It's also worth mentioning that I don't have this issue with Karaf 4.0.8

      Attachments

        1. screenshot-1.png
          5 kB
          Benjamin Graf

        Issue Links

          Activity

            People

              jbonofre Jean-Baptiste Onofré
              tbouron Thomas Bouron
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: