karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Onofré (JIRA) <j...@apache.org>
Subject [jira] [Commented] (KARAF-3460) NPE in AutoEncryptionSupport.run
Date Wed, 21 Jan 2015 21:22:35 GMT

    [ https://issues.apache.org/jira/browse/KARAF-3460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14286290#comment-14286290
] 

Jean-Baptiste Onofré commented on KARAF-3460:
---------------------------------------------

I suspect a race condition: the destroy() method is called, closing the watchService and setting
it to null, while the thread use it.

To prevent this, we should just add a workaround:

{code}
            if (watchService == null) {
                // just to prevent NPE (KARAF-3460)
                watchService = FileSystems.getDefault().newWatchService();
            }
            dir.register(watchService, ENTRY_MODIFY);
{code}

in the Thread run().

I'm testing it ...

> NPE in AutoEncryptionSupport.run
> --------------------------------
>
>                 Key: KARAF-3460
>                 URL: https://issues.apache.org/jira/browse/KARAF-3460
>             Project: Karaf
>          Issue Type: Bug
>    Affects Versions: 4.0.0
>            Reporter: Christian Schneider
>            Assignee: Christian Schneider
>             Fix For: 4.0.0
>
>
> In the itests I often see this stack trace of a NPE:
> karaf@root()> Exception in thread "AutoEncryptionSupport" java.lang.NullPointerException
> 	at sun.nio.fs.UnixPath.register(UnixPath.java:893)
> 	at sun.nio.fs.AbstractPath.register(AbstractPath.java:104)
> 	at org.apache.karaf.jaas.modules.properties.AutoEncryptionSupport.run(AutoEncryptionSupport.java:79)
> 	at java.lang.Thread.run(Thread.java:745)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message