You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Christoph Läubrich (JIRA)" <ji...@apache.org> on 2012/08/20 12:40:37 UTC

[jira] [Created] (KARAF-1748) Karaf startup fails with NullPointerException when logfile can't be written

Christoph Läubrich created KARAF-1748:
-----------------------------------------

             Summary: Karaf startup fails with NullPointerException when logfile can't be written
                 Key: KARAF-1748
                 URL: https://issues.apache.org/jira/browse/KARAF-1748
             Project: Karaf
          Issue Type: Bug
            Reporter: Christoph Läubrich
            Priority: Minor


The karaf startup fails with a NullPointerException when the logifle can't be accessed:

java.io.FileNotFoundException: /opt/karaf/data/log/karaf.log (Permission denied)
        at java.io.FileOutputStream.openAppend(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:177)
        at org.apache.karaf.main.BootstrapLogManager$SimpleFileHandler.open(BootstrapLogManager.java:115)
        at org.apache.karaf.main.BootstrapLogManager$SimpleFileHandler.<init>(BootstrapLogManager.java:104)
        at org.apache.karaf.main.BootstrapLogManager.getDefaultHandler(BootstrapLogManager.java:83)
        at org.apache.karaf.main.Main.launch(Main.java:234)
        at org.apache.karaf.main.Main.main(Main.java:429)
Could not create framework: java.lang.NullPointerException
java.lang.NullPointerException
        at java.util.logging.Logger.addHandler(Logger.java:1185)
        at org.apache.karaf.main.Main.launch(Main.java:234)
        at org.apache.karaf.main.Main.main(Main.java:429)

This should be changed to: Output a meaningfull message e.g. "Karaf can't startup, make sure the logifle can be accessed and written by the user starting Karaf",
OR
try to allocate a logfile with a different name.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (KARAF-1748) Karaf startup fails with NullPointerException when logfile can't be written

Posted by "Heath Kesler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-1748?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Heath Kesler updated KARAF-1748:
--------------------------------

    Attachment: karaf-3.0_1748.diff

updated the BootstrapLogManager to throw exception rather then doing a printstacktrace to give calling classes more control over what gets printed to the console.  The main class will now only print out the exception message, but the stack trace will still get logged (if it is an exception that does not involve an issue with instantiating the log file).  

I am looking for feedback on this patch,I am not 100% convinced that I should not be writing out the stack trace, but I do not know of an issue where it should.  

All tests pass.

Thanks
Heath
                
> Karaf startup fails with NullPointerException when logfile can't be written
> ---------------------------------------------------------------------------
>
>                 Key: KARAF-1748
>                 URL: https://issues.apache.org/jira/browse/KARAF-1748
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-core
>    Affects Versions: 2.2.9, 2.3.0, 3.0.0
>            Reporter: Christoph Läubrich
>            Priority: Minor
>         Attachments: karaf-3.0_1748.diff
>
>
> The karaf startup fails with a NullPointerException when the logifle can't be accessed:
> java.io.FileNotFoundException: /opt/karaf/data/log/karaf.log (Permission denied)
>         at java.io.FileOutputStream.openAppend(Native Method)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:177)
>         at org.apache.karaf.main.BootstrapLogManager$SimpleFileHandler.open(BootstrapLogManager.java:115)
>         at org.apache.karaf.main.BootstrapLogManager$SimpleFileHandler.<init>(BootstrapLogManager.java:104)
>         at org.apache.karaf.main.BootstrapLogManager.getDefaultHandler(BootstrapLogManager.java:83)
>         at org.apache.karaf.main.Main.launch(Main.java:234)
>         at org.apache.karaf.main.Main.main(Main.java:429)
> Could not create framework: java.lang.NullPointerException
> java.lang.NullPointerException
>         at java.util.logging.Logger.addHandler(Logger.java:1185)
>         at org.apache.karaf.main.Main.launch(Main.java:234)
>         at org.apache.karaf.main.Main.main(Main.java:429)
> This should be changed to: Output a meaningfull message e.g. "Karaf can't startup, make sure the logifle can be accessed and written by the user starting Karaf",
> OR
> try to allocate a logfile with a different name.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (KARAF-1748) Karaf startup fails with NullPointerException when logfile can't be written

Posted by "Christoph Läubrich (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KARAF-1748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13437814#comment-13437814 ] 

Christoph Läubrich commented on KARAF-1748:
-------------------------------------------

The exact version is 2.2.8, I think I have seen this before on a 2.2.7 as well.
                
> Karaf startup fails with NullPointerException when logfile can't be written
> ---------------------------------------------------------------------------
>
>                 Key: KARAF-1748
>                 URL: https://issues.apache.org/jira/browse/KARAF-1748
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-core
>    Affects Versions: 2.2.9, 2.3.0, 3.0.0
>            Reporter: Christoph Läubrich
>            Priority: Minor
>
> The karaf startup fails with a NullPointerException when the logifle can't be accessed:
> java.io.FileNotFoundException: /opt/karaf/data/log/karaf.log (Permission denied)
>         at java.io.FileOutputStream.openAppend(Native Method)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:177)
>         at org.apache.karaf.main.BootstrapLogManager$SimpleFileHandler.open(BootstrapLogManager.java:115)
>         at org.apache.karaf.main.BootstrapLogManager$SimpleFileHandler.<init>(BootstrapLogManager.java:104)
>         at org.apache.karaf.main.BootstrapLogManager.getDefaultHandler(BootstrapLogManager.java:83)
>         at org.apache.karaf.main.Main.launch(Main.java:234)
>         at org.apache.karaf.main.Main.main(Main.java:429)
> Could not create framework: java.lang.NullPointerException
> java.lang.NullPointerException
>         at java.util.logging.Logger.addHandler(Logger.java:1185)
>         at org.apache.karaf.main.Main.launch(Main.java:234)
>         at org.apache.karaf.main.Main.main(Main.java:429)
> This should be changed to: Output a meaningfull message e.g. "Karaf can't startup, make sure the logifle can be accessed and written by the user starting Karaf",
> OR
> try to allocate a logfile with a different name.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (KARAF-1748) Karaf startup fails with NullPointerException when logfile can't be written

Posted by "Andreas Pieber (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-1748?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Pieber updated KARAF-1748:
----------------------------------

          Component/s: karaf-core
    Affects Version/s: 3.0.0
                       2.3.0
                       2.2.9

I bluntly assume all karaf versions are affected? With which version have you encountered the problem?
                
> Karaf startup fails with NullPointerException when logfile can't be written
> ---------------------------------------------------------------------------
>
>                 Key: KARAF-1748
>                 URL: https://issues.apache.org/jira/browse/KARAF-1748
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-core
>    Affects Versions: 2.2.9, 2.3.0, 3.0.0
>            Reporter: Christoph Läubrich
>            Priority: Minor
>
> The karaf startup fails with a NullPointerException when the logifle can't be accessed:
> java.io.FileNotFoundException: /opt/karaf/data/log/karaf.log (Permission denied)
>         at java.io.FileOutputStream.openAppend(Native Method)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:177)
>         at org.apache.karaf.main.BootstrapLogManager$SimpleFileHandler.open(BootstrapLogManager.java:115)
>         at org.apache.karaf.main.BootstrapLogManager$SimpleFileHandler.<init>(BootstrapLogManager.java:104)
>         at org.apache.karaf.main.BootstrapLogManager.getDefaultHandler(BootstrapLogManager.java:83)
>         at org.apache.karaf.main.Main.launch(Main.java:234)
>         at org.apache.karaf.main.Main.main(Main.java:429)
> Could not create framework: java.lang.NullPointerException
> java.lang.NullPointerException
>         at java.util.logging.Logger.addHandler(Logger.java:1185)
>         at org.apache.karaf.main.Main.launch(Main.java:234)
>         at org.apache.karaf.main.Main.main(Main.java:429)
> This should be changed to: Output a meaningfull message e.g. "Karaf can't startup, make sure the logifle can be accessed and written by the user starting Karaf",
> OR
> try to allocate a logfile with a different name.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (KARAF-1748) Karaf startup fails with NullPointerException when logfile can't be written

Posted by "Andreas Pieber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KARAF-1748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13448560#comment-13448560 ] 

Andreas Pieber commented on KARAF-1748:
---------------------------------------

I think so too, exception message + a short general description should be enough.
                
> Karaf startup fails with NullPointerException when logfile can't be written
> ---------------------------------------------------------------------------
>
>                 Key: KARAF-1748
>                 URL: https://issues.apache.org/jira/browse/KARAF-1748
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-core
>    Affects Versions: 2.2.9, 2.3.0, 3.0.0
>            Reporter: Christoph Läubrich
>            Priority: Minor
>
> The karaf startup fails with a NullPointerException when the logifle can't be accessed:
> java.io.FileNotFoundException: /opt/karaf/data/log/karaf.log (Permission denied)
>         at java.io.FileOutputStream.openAppend(Native Method)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:177)
>         at org.apache.karaf.main.BootstrapLogManager$SimpleFileHandler.open(BootstrapLogManager.java:115)
>         at org.apache.karaf.main.BootstrapLogManager$SimpleFileHandler.<init>(BootstrapLogManager.java:104)
>         at org.apache.karaf.main.BootstrapLogManager.getDefaultHandler(BootstrapLogManager.java:83)
>         at org.apache.karaf.main.Main.launch(Main.java:234)
>         at org.apache.karaf.main.Main.main(Main.java:429)
> Could not create framework: java.lang.NullPointerException
> java.lang.NullPointerException
>         at java.util.logging.Logger.addHandler(Logger.java:1185)
>         at org.apache.karaf.main.Main.launch(Main.java:234)
>         at org.apache.karaf.main.Main.main(Main.java:429)
> This should be changed to: Output a meaningfull message e.g. "Karaf can't startup, make sure the logifle can be accessed and written by the user starting Karaf",
> OR
> try to allocate a logfile with a different name.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (KARAF-1748) Karaf startup fails with NullPointerException when logfile can't be written

Posted by "Christoph Läubrich (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KARAF-1748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13448517#comment-13448517 ] 

Christoph Läubrich commented on KARAF-1748:
-------------------------------------------

I think it should only print out a message, but include somewhere the exception message (the Permission denied part).
This way its clear for the user what to do.
                
> Karaf startup fails with NullPointerException when logfile can't be written
> ---------------------------------------------------------------------------
>
>                 Key: KARAF-1748
>                 URL: https://issues.apache.org/jira/browse/KARAF-1748
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-core
>    Affects Versions: 2.2.9, 2.3.0, 3.0.0
>            Reporter: Christoph Läubrich
>            Priority: Minor
>
> The karaf startup fails with a NullPointerException when the logifle can't be accessed:
> java.io.FileNotFoundException: /opt/karaf/data/log/karaf.log (Permission denied)
>         at java.io.FileOutputStream.openAppend(Native Method)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:177)
>         at org.apache.karaf.main.BootstrapLogManager$SimpleFileHandler.open(BootstrapLogManager.java:115)
>         at org.apache.karaf.main.BootstrapLogManager$SimpleFileHandler.<init>(BootstrapLogManager.java:104)
>         at org.apache.karaf.main.BootstrapLogManager.getDefaultHandler(BootstrapLogManager.java:83)
>         at org.apache.karaf.main.Main.launch(Main.java:234)
>         at org.apache.karaf.main.Main.main(Main.java:429)
> Could not create framework: java.lang.NullPointerException
> java.lang.NullPointerException
>         at java.util.logging.Logger.addHandler(Logger.java:1185)
>         at org.apache.karaf.main.Main.launch(Main.java:234)
>         at org.apache.karaf.main.Main.main(Main.java:429)
> This should be changed to: Output a meaningfull message e.g. "Karaf can't startup, make sure the logifle can be accessed and written by the user starting Karaf",
> OR
> try to allocate a logfile with a different name.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (KARAF-1748) Karaf startup fails with NullPointerException when logfile can't be written

Posted by "Heath Kesler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KARAF-1748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13448430#comment-13448430 ] 

Heath Kesler commented on KARAF-1748:
-------------------------------------

Should this avoid all stack traces and only print the message or are we just looking to add a more meaningful message to the exceptions?  It seems to me that just printing the message would be the more complete solution since the stack trace is no longer needed in that instance, but was looking for some feedback.

This is still the exception in 3.0 also.
                
> Karaf startup fails with NullPointerException when logfile can't be written
> ---------------------------------------------------------------------------
>
>                 Key: KARAF-1748
>                 URL: https://issues.apache.org/jira/browse/KARAF-1748
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-core
>    Affects Versions: 2.2.9, 2.3.0, 3.0.0
>            Reporter: Christoph Läubrich
>            Priority: Minor
>
> The karaf startup fails with a NullPointerException when the logifle can't be accessed:
> java.io.FileNotFoundException: /opt/karaf/data/log/karaf.log (Permission denied)
>         at java.io.FileOutputStream.openAppend(Native Method)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:177)
>         at org.apache.karaf.main.BootstrapLogManager$SimpleFileHandler.open(BootstrapLogManager.java:115)
>         at org.apache.karaf.main.BootstrapLogManager$SimpleFileHandler.<init>(BootstrapLogManager.java:104)
>         at org.apache.karaf.main.BootstrapLogManager.getDefaultHandler(BootstrapLogManager.java:83)
>         at org.apache.karaf.main.Main.launch(Main.java:234)
>         at org.apache.karaf.main.Main.main(Main.java:429)
> Could not create framework: java.lang.NullPointerException
> java.lang.NullPointerException
>         at java.util.logging.Logger.addHandler(Logger.java:1185)
>         at org.apache.karaf.main.Main.launch(Main.java:234)
>         at org.apache.karaf.main.Main.main(Main.java:429)
> This should be changed to: Output a meaningfull message e.g. "Karaf can't startup, make sure the logifle can be accessed and written by the user starting Karaf",
> OR
> try to allocate a logfile with a different name.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira