Karaf
  1. Karaf
  2. KARAF-670

Missing ${karaf.base}/system cause NullPointerException

    Details

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

      running karaf via Talend Service Factory 2.4.0.0, Win7, Oracle JDK1.6.0.25

      Description

      I manually created an instance and set karaf.base to the new instance folder, but I forgot to create the folder $

      {karaf.base}

      /system. This missing folder died on dir.listFiles() in Main.findFiles(). That method checks theFile for existence, but its caller forgets to check bundleDir.

      Could not create framework: java.lang.NullPointerException
      java.lang.NullPointerException
      at org.apache.karaf.main.Main.findFile(Main.java:1063)
      at org.apache.karaf.main.Main.findFile(Main.java:1048)
      at org.apache.karaf.main.Main.processConfigurationProperties(Main.java:1014)
      at org.apache.karaf.main.Main.loadConfigProperties(Main.java:873)
      at org.apache.karaf.main.Main.launch(Main.java:225)
      at org.apache.karaf.main.Main.main(Main.java:416)
      Error occured shutting down framework: java.lang.NullPointerException
      java.lang.NullPointerException
      at org.apache.karaf.main.Main.awaitShutdown(Main.java:274)
      at org.apache.karaf.main.Main.main(Main.java:423)

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        1d 14h 43m 1 Jean-Baptiste Onofré 09/Jun/11 07:17
        In Progress In Progress Resolved Resolved
        3h 39m 1 Jean-Baptiste Onofré 09/Jun/11 10:57
        Resolved Resolved Closed Closed
        25d 8h 55m 1 Jamie goodyear 04/Jul/11 19:52
        Hide
        Matt Magoffin added a comment -

        I just ran into this issue in Karaf 2.3.5. I started with KARAF_BASE set to a directory that had only etc, data, and deploy directories, and Karaf fails with

        Unable to update instance pid: Child instance started but no root registered in /usr/local/opt/cave-2.3.5/instances/instance.properties
        Could not create framework: java.lang.NullPointerException
        java.lang.NullPointerException
        	at org.apache.karaf.main.Main.findFile(Main.java:1223)
        	at org.apache.karaf.main.Main.findFile(Main.java:1208)
        	at org.apache.karaf.main.Main.processConfigurationProperties(Main.java:1171)
        	at org.apache.karaf.main.Main.loadStartupProperties(Main.java:1015)
        	at org.apache.karaf.main.Main.launch(Main.java:297)
        	at org.apache.karaf.main.Main.main(Main.java:507)
        

        Perhaps there is a regression?

        Show
        Matt Magoffin added a comment - I just ran into this issue in Karaf 2.3.5. I started with KARAF_BASE set to a directory that had only etc , data , and deploy directories, and Karaf fails with Unable to update instance pid: Child instance started but no root registered in /usr/local/opt/cave-2.3.5/instances/instance.properties Could not create framework: java.lang.NullPointerException java.lang.NullPointerException at org.apache.karaf.main.Main.findFile(Main.java:1223) at org.apache.karaf.main.Main.findFile(Main.java:1208) at org.apache.karaf.main.Main.processConfigurationProperties(Main.java:1171) at org.apache.karaf.main.Main.loadStartupProperties(Main.java:1015) at org.apache.karaf.main.Main.launch(Main.java:297) at org.apache.karaf.main.Main.main(Main.java:507) Perhaps there is a regression?
        Jamie goodyear made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Jamie goodyear added a comment -

        Fixed in Apache Karaf 2.2.2.

        Show
        Jamie goodyear added a comment - Fixed in Apache Karaf 2.2.2.
        Jean-Baptiste Onofré made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Jean-Baptiste Onofré added a comment -

        Committing to https://svn.apache.org/repos/asf/karaf/branches/karaf-2.2.x ...
        M main/src/main/java/org/apache/karaf/main/Main.java
        Committed r1133759

        Show
        Jean-Baptiste Onofré added a comment - Committing to https://svn.apache.org/repos/asf/karaf/branches/karaf-2.2.x ... M main/src/main/java/org/apache/karaf/main/Main.java Committed r1133759
        Hide
        Jean-Baptiste Onofré added a comment -

        Committing to https://svn.apache.org/repos/asf/karaf/trunk ...
        M main/src/main/java/org/apache/karaf/main/Main.java
        Committed r1133718

        Show
        Jean-Baptiste Onofré added a comment - Committing to https://svn.apache.org/repos/asf/karaf/trunk ... M main/src/main/java/org/apache/karaf/main/Main.java Committed r1133718
        Hide
        Jean-Baptiste Onofré added a comment -

        Karaf can't start without the system folder as it contains the OSGi framework (Apache Felix framework and Equinox).

        So, I'm gonna add a check in the Main to see if the system folder (identified by $

        {karaf.default.repository}

        /system) is available at bootstrap.
        In the same way, etc folder should be check.

        Show
        Jean-Baptiste Onofré added a comment - Karaf can't start without the system folder as it contains the OSGi framework (Apache Felix framework and Equinox). So, I'm gonna add a check in the Main to see if the system folder (identified by $ {karaf.default.repository} /system) is available at bootstrap. In the same way, etc folder should be check.
        Jean-Baptiste Onofré made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Jean-Baptiste Onofré made changes -
        Fix Version/s 2.2.2 [ 12316339 ]
        Fix Version/s 3.0.0 [ 12316040 ]
        Jean-Baptiste Onofré made changes -
        Field Original Value New Value
        Assignee Jean-Baptiste Onofré [ jbonofre ]
        Chris Dolan created issue -

          People

          • Assignee:
            Jean-Baptiste Onofré
            Reporter:
            Chris Dolan
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development