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

Börcsök József commented on KARAF-5313:
---------------------------------------

I found a similar issue using Felix Fileinstall 3.6.0. I've created a 
declarative service via ConfigAdmin and the above exeption is thrown when tried 
to delete the component.

This is how service is created:
{code}
    final Configuration cfg = 
configAdmin.createFactoryConfiguration(factoryPid, "?");
    final Dictionary<String, Object> props = new Hashtable<>();
    cfg.update(props);
{code}

And how it is removed (filter is an OSGi filter expression of ID based on props 
of creation):
{code}
    final Configuration[] cfgsToDelete = configAdmin.listConfigurations(filter);

    if (cfgsToDelete != null) {
        for (final Configuration c : cfgsToDelete) {
            c.delete();
        }
    } else {
        log.warn("No configuration found: " + filter);
    }
{code}

NPE is thrown because dictionary (dict = config.getProperties()) is NULL at 
line 179 in org.apache.felix.fileinstall.internal.ConfigInstaller that is not 
handled, setting fileName should check it at the next line.

> Exception when deleting a .cfg file from hot deploy directory 
> --------------------------------------------------------------
>
>                 Key: KARAF-5313
>                 URL: https://issues.apache.org/jira/browse/KARAF-5313
>             Project: Karaf
>          Issue Type: Bug
>    Affects Versions: 4.1.2
>         Environment: Windows 7
>            Reporter: Scott Leschke
>            Assignee: Jean-Baptiste Onofré
>             Fix For: 4.2.0, 4.1.3, 4.0.11
>
>
> 2017-08-17T14:03:37,333 | INFO  | CM Event Dispatcher (Fire 
> ConfigurationEvent: 
> pid=bam.provider.query.cae236fc-adc4-437f-9197-0f58eda1d049) | fileinstall    
>                   | 8 - org.apache.felix.fileinstall - 3.6.0 | Unable to 
> delete configuration file
> java.lang.NullPointerException: null
>       at 
> org.apache.felix.fileinstall.internal.ConfigInstaller.doConfigurationEvent(ConfigInstaller.java:180)
>  [8:org.apache.felix.fileinstall:3.6.0]
>       at 
> org.apache.felix.fileinstall.internal.ConfigInstaller.configurationEvent(ConfigInstaller.java:108)
>  [8:org.apache.felix.fileinstall:3.6.0]
>       at 
> org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.sendEvent(ConfigurationManager.java:2074)
>  [7:org.apache.felix.configadmin:1.8.14]
>       at 
> org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:2042)
>  [7:org.apache.felix.configadmin:1.8.14]
>       at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141) 
> [7:org.apache.felix.configadmin:1.8.14]
>       at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109) 
> [7:org.apache.felix.configadmin:1.8.14]
>       at java.lang.Thread.run(Thread.java:748) [?:?]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to