You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Zachery Jensen (JIRA)" <ji...@apache.org> on 2009/11/05 13:07:03 UTC

[jira] Created: (FELIX-1846) When updated configuration of component without a previously set target filter, NullPointerException is thrown

When updated configuration of component without a previously set target filter, NullPointerException is thrown
--------------------------------------------------------------------------------------------------------------

                 Key: FELIX-1846
                 URL: https://issues.apache.org/jira/browse/FELIX-1846
             Project: Felix
          Issue Type: Bug
          Components: Declarative Services (SCR)
         Environment: Java 1.5 on Mac, Felix 2.0.1 started by Pax Runner, build based on Revision: 832970 from http://svn.apache.org/repos/asf/felix/trunk
            Reporter: Zachery Jensen
            Priority: Blocker


If the target filter is undefined for a component before a change is made to its configuration (in this case, by way of config admin and fileinstall) it will always throw this NullPointerException because the clause at the associated line of code is bad.  It doesn't sufficiently guard for null return values for getTarget() before potentially dereferencing off getTarget()'s return.

Workaround is to set any target filter, though that's not an acceptable workaround in my opinion... at least it works.

If a target filter is set it seems to work as expected.

*ERROR* Unexpected problem delivery configuration event to [org.osgi.service.cm.ConfigurationListener, id=24, bundle=3]
java.lang.NullPointerException
	at org.apache.felix.scr.impl.manager.DependencyManager.canUpdateDynamically(DependencyManager.java:1068)
	at org.apache.felix.scr.impl.manager.ImmediateComponentManager.modify(ImmediateComponentManager.java:432)
	at org.apache.felix.scr.impl.manager.ImmediateComponentManager.reconfigure(ImmediateComponentManager.java:401)
	at org.apache.felix.scr.impl.config.ConfiguredComponentHolder.configurationUpdated(ConfiguredComponentHolder.java:187)
	at org.apache.felix.scr.impl.config.ConfigurationComponentRegistry.configurationEvent(ConfigurationComponentRegistry.java:173)
	at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:1693)
	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:88)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1846) When updated configuration of component without a previously set target filter, NullPointerException is thrown

Posted by "Zachery Jensen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12774094#action_12774094 ] 

Zachery Jensen commented on FELIX-1846:
---------------------------------------

I can confirm that it's fixed.  Nice response time!

Just to be clear, I just svn up'd which put me in rev 833173, but, the only actual file that came down to me was the one relevant to this change.

> When updated configuration of component without a previously set target filter, NullPointerException is thrown
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1846
>                 URL: https://issues.apache.org/jira/browse/FELIX-1846
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.2.0
>         Environment: Java 1.5 on Mac, Felix 2.0.1 started by Pax Runner, build based on Revision: 832970 from http://svn.apache.org/repos/asf/felix/trunk
>            Reporter: Zachery Jensen
>            Assignee: Felix Meschberger
>            Priority: Blocker
>             Fix For:  scr-1.2.2
>
>
> If the target filter is undefined for a component before a change is made to its configuration (in this case, by way of config admin and fileinstall) it will always throw this NullPointerException because the clause at the associated line of code is bad.  It doesn't sufficiently guard for null return values for getTarget() before potentially dereferencing off getTarget()'s return.
> Workaround is to set any target filter, though that's not an acceptable workaround in my opinion... at least it works.
> If a target filter is set it seems to work as expected.
> *ERROR* Unexpected problem delivery configuration event to [org.osgi.service.cm.ConfigurationListener, id=24, bundle=3]
> java.lang.NullPointerException
> 	at org.apache.felix.scr.impl.manager.DependencyManager.canUpdateDynamically(DependencyManager.java:1068)
> 	at org.apache.felix.scr.impl.manager.ImmediateComponentManager.modify(ImmediateComponentManager.java:432)
> 	at org.apache.felix.scr.impl.manager.ImmediateComponentManager.reconfigure(ImmediateComponentManager.java:401)
> 	at org.apache.felix.scr.impl.config.ConfiguredComponentHolder.configurationUpdated(ConfiguredComponentHolder.java:187)
> 	at org.apache.felix.scr.impl.config.ConfigurationComponentRegistry.configurationEvent(ConfigurationComponentRegistry.java:173)
> 	at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:1693)
> 	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:88)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1846) When updated configuration of component without a previously set target filter, NullPointerException is thrown

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773970#action_12773970 ] 

Felix Meschberger commented on FELIX-1846:
------------------------------------------

Thanks for reporting this bug.

It is this expression causing the problem, right :

     if ( ( getTarget() == null && targetFilter == null ) || getTarget().equals( targetFilter ) )



> When updated configuration of component without a previously set target filter, NullPointerException is thrown
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1846
>                 URL: https://issues.apache.org/jira/browse/FELIX-1846
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>         Environment: Java 1.5 on Mac, Felix 2.0.1 started by Pax Runner, build based on Revision: 832970 from http://svn.apache.org/repos/asf/felix/trunk
>            Reporter: Zachery Jensen
>            Assignee: Felix Meschberger
>            Priority: Blocker
>
> If the target filter is undefined for a component before a change is made to its configuration (in this case, by way of config admin and fileinstall) it will always throw this NullPointerException because the clause at the associated line of code is bad.  It doesn't sufficiently guard for null return values for getTarget() before potentially dereferencing off getTarget()'s return.
> Workaround is to set any target filter, though that's not an acceptable workaround in my opinion... at least it works.
> If a target filter is set it seems to work as expected.
> *ERROR* Unexpected problem delivery configuration event to [org.osgi.service.cm.ConfigurationListener, id=24, bundle=3]
> java.lang.NullPointerException
> 	at org.apache.felix.scr.impl.manager.DependencyManager.canUpdateDynamically(DependencyManager.java:1068)
> 	at org.apache.felix.scr.impl.manager.ImmediateComponentManager.modify(ImmediateComponentManager.java:432)
> 	at org.apache.felix.scr.impl.manager.ImmediateComponentManager.reconfigure(ImmediateComponentManager.java:401)
> 	at org.apache.felix.scr.impl.config.ConfiguredComponentHolder.configurationUpdated(ConfiguredComponentHolder.java:187)
> 	at org.apache.felix.scr.impl.config.ConfigurationComponentRegistry.configurationEvent(ConfigurationComponentRegistry.java:173)
> 	at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:1693)
> 	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:88)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1846) When updated configuration of component without a previously set target filter, NullPointerException is thrown

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

Felix Meschberger updated FELIX-1846:
-------------------------------------

    Affects Version/s: scr-1.2.0

> When updated configuration of component without a previously set target filter, NullPointerException is thrown
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1846
>                 URL: https://issues.apache.org/jira/browse/FELIX-1846
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.2.0
>         Environment: Java 1.5 on Mac, Felix 2.0.1 started by Pax Runner, build based on Revision: 832970 from http://svn.apache.org/repos/asf/felix/trunk
>            Reporter: Zachery Jensen
>            Assignee: Felix Meschberger
>            Priority: Blocker
>             Fix For:  scr-1.2.2
>
>
> If the target filter is undefined for a component before a change is made to its configuration (in this case, by way of config admin and fileinstall) it will always throw this NullPointerException because the clause at the associated line of code is bad.  It doesn't sufficiently guard for null return values for getTarget() before potentially dereferencing off getTarget()'s return.
> Workaround is to set any target filter, though that's not an acceptable workaround in my opinion... at least it works.
> If a target filter is set it seems to work as expected.
> *ERROR* Unexpected problem delivery configuration event to [org.osgi.service.cm.ConfigurationListener, id=24, bundle=3]
> java.lang.NullPointerException
> 	at org.apache.felix.scr.impl.manager.DependencyManager.canUpdateDynamically(DependencyManager.java:1068)
> 	at org.apache.felix.scr.impl.manager.ImmediateComponentManager.modify(ImmediateComponentManager.java:432)
> 	at org.apache.felix.scr.impl.manager.ImmediateComponentManager.reconfigure(ImmediateComponentManager.java:401)
> 	at org.apache.felix.scr.impl.config.ConfiguredComponentHolder.configurationUpdated(ConfiguredComponentHolder.java:187)
> 	at org.apache.felix.scr.impl.config.ConfigurationComponentRegistry.configurationEvent(ConfigurationComponentRegistry.java:173)
> 	at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:1693)
> 	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:88)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (FELIX-1846) When updated configuration of component without a previously set target filter, NullPointerException is thrown

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

Felix Meschberger resolved FELIX-1846.
--------------------------------------

       Resolution: Fixed
    Fix Version/s:  scr-1.2.2

Implemented a guard against the NPE in Rev. 833085

Can you please verify ? Thanks.

> When updated configuration of component without a previously set target filter, NullPointerException is thrown
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1846
>                 URL: https://issues.apache.org/jira/browse/FELIX-1846
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.2.0
>         Environment: Java 1.5 on Mac, Felix 2.0.1 started by Pax Runner, build based on Revision: 832970 from http://svn.apache.org/repos/asf/felix/trunk
>            Reporter: Zachery Jensen
>            Assignee: Felix Meschberger
>            Priority: Blocker
>             Fix For:  scr-1.2.2
>
>
> If the target filter is undefined for a component before a change is made to its configuration (in this case, by way of config admin and fileinstall) it will always throw this NullPointerException because the clause at the associated line of code is bad.  It doesn't sufficiently guard for null return values for getTarget() before potentially dereferencing off getTarget()'s return.
> Workaround is to set any target filter, though that's not an acceptable workaround in my opinion... at least it works.
> If a target filter is set it seems to work as expected.
> *ERROR* Unexpected problem delivery configuration event to [org.osgi.service.cm.ConfigurationListener, id=24, bundle=3]
> java.lang.NullPointerException
> 	at org.apache.felix.scr.impl.manager.DependencyManager.canUpdateDynamically(DependencyManager.java:1068)
> 	at org.apache.felix.scr.impl.manager.ImmediateComponentManager.modify(ImmediateComponentManager.java:432)
> 	at org.apache.felix.scr.impl.manager.ImmediateComponentManager.reconfigure(ImmediateComponentManager.java:401)
> 	at org.apache.felix.scr.impl.config.ConfiguredComponentHolder.configurationUpdated(ConfiguredComponentHolder.java:187)
> 	at org.apache.felix.scr.impl.config.ConfigurationComponentRegistry.configurationEvent(ConfigurationComponentRegistry.java:173)
> 	at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:1693)
> 	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:88)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (FELIX-1846) When updated configuration of component without a previously set target filter, NullPointerException is thrown

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

Felix Meschberger reassigned FELIX-1846:
----------------------------------------

    Assignee: Felix Meschberger

> When updated configuration of component without a previously set target filter, NullPointerException is thrown
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1846
>                 URL: https://issues.apache.org/jira/browse/FELIX-1846
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>         Environment: Java 1.5 on Mac, Felix 2.0.1 started by Pax Runner, build based on Revision: 832970 from http://svn.apache.org/repos/asf/felix/trunk
>            Reporter: Zachery Jensen
>            Assignee: Felix Meschberger
>            Priority: Blocker
>
> If the target filter is undefined for a component before a change is made to its configuration (in this case, by way of config admin and fileinstall) it will always throw this NullPointerException because the clause at the associated line of code is bad.  It doesn't sufficiently guard for null return values for getTarget() before potentially dereferencing off getTarget()'s return.
> Workaround is to set any target filter, though that's not an acceptable workaround in my opinion... at least it works.
> If a target filter is set it seems to work as expected.
> *ERROR* Unexpected problem delivery configuration event to [org.osgi.service.cm.ConfigurationListener, id=24, bundle=3]
> java.lang.NullPointerException
> 	at org.apache.felix.scr.impl.manager.DependencyManager.canUpdateDynamically(DependencyManager.java:1068)
> 	at org.apache.felix.scr.impl.manager.ImmediateComponentManager.modify(ImmediateComponentManager.java:432)
> 	at org.apache.felix.scr.impl.manager.ImmediateComponentManager.reconfigure(ImmediateComponentManager.java:401)
> 	at org.apache.felix.scr.impl.config.ConfiguredComponentHolder.configurationUpdated(ConfiguredComponentHolder.java:187)
> 	at org.apache.felix.scr.impl.config.ConfigurationComponentRegistry.configurationEvent(ConfigurationComponentRegistry.java:173)
> 	at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:1693)
> 	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:88)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (FELIX-1846) When updated configuration of component without a previously set target filter, NullPointerException is thrown

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

Felix Meschberger closed FELIX-1846.
------------------------------------


Closing since version is released.

> When updated configuration of component without a previously set target filter, NullPointerException is thrown
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1846
>                 URL: https://issues.apache.org/jira/browse/FELIX-1846
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.2.0
>         Environment: Java 1.5 on Mac, Felix 2.0.1 started by Pax Runner, build based on Revision: 832970 from http://svn.apache.org/repos/asf/felix/trunk
>            Reporter: Zachery Jensen
>            Assignee: Felix Meschberger
>            Priority: Blocker
>             Fix For:  scr-1.4.0
>
>
> If the target filter is undefined for a component before a change is made to its configuration (in this case, by way of config admin and fileinstall) it will always throw this NullPointerException because the clause at the associated line of code is bad.  It doesn't sufficiently guard for null return values for getTarget() before potentially dereferencing off getTarget()'s return.
> Workaround is to set any target filter, though that's not an acceptable workaround in my opinion... at least it works.
> If a target filter is set it seems to work as expected.
> *ERROR* Unexpected problem delivery configuration event to [org.osgi.service.cm.ConfigurationListener, id=24, bundle=3]
> java.lang.NullPointerException
> 	at org.apache.felix.scr.impl.manager.DependencyManager.canUpdateDynamically(DependencyManager.java:1068)
> 	at org.apache.felix.scr.impl.manager.ImmediateComponentManager.modify(ImmediateComponentManager.java:432)
> 	at org.apache.felix.scr.impl.manager.ImmediateComponentManager.reconfigure(ImmediateComponentManager.java:401)
> 	at org.apache.felix.scr.impl.config.ConfiguredComponentHolder.configurationUpdated(ConfiguredComponentHolder.java:187)
> 	at org.apache.felix.scr.impl.config.ConfigurationComponentRegistry.configurationEvent(ConfigurationComponentRegistry.java:173)
> 	at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:1693)
> 	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:88)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1846) When updated configuration of component without a previously set target filter, NullPointerException is thrown

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12774124#action_12774124 ] 

Felix Meschberger commented on FELIX-1846:
------------------------------------------

Thanks for the feedback.

> When updated configuration of component without a previously set target filter, NullPointerException is thrown
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1846
>                 URL: https://issues.apache.org/jira/browse/FELIX-1846
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.2.0
>         Environment: Java 1.5 on Mac, Felix 2.0.1 started by Pax Runner, build based on Revision: 832970 from http://svn.apache.org/repos/asf/felix/trunk
>            Reporter: Zachery Jensen
>            Assignee: Felix Meschberger
>            Priority: Blocker
>             Fix For:  scr-1.2.2
>
>
> If the target filter is undefined for a component before a change is made to its configuration (in this case, by way of config admin and fileinstall) it will always throw this NullPointerException because the clause at the associated line of code is bad.  It doesn't sufficiently guard for null return values for getTarget() before potentially dereferencing off getTarget()'s return.
> Workaround is to set any target filter, though that's not an acceptable workaround in my opinion... at least it works.
> If a target filter is set it seems to work as expected.
> *ERROR* Unexpected problem delivery configuration event to [org.osgi.service.cm.ConfigurationListener, id=24, bundle=3]
> java.lang.NullPointerException
> 	at org.apache.felix.scr.impl.manager.DependencyManager.canUpdateDynamically(DependencyManager.java:1068)
> 	at org.apache.felix.scr.impl.manager.ImmediateComponentManager.modify(ImmediateComponentManager.java:432)
> 	at org.apache.felix.scr.impl.manager.ImmediateComponentManager.reconfigure(ImmediateComponentManager.java:401)
> 	at org.apache.felix.scr.impl.config.ConfiguredComponentHolder.configurationUpdated(ConfiguredComponentHolder.java:187)
> 	at org.apache.felix.scr.impl.config.ConfigurationComponentRegistry.configurationEvent(ConfigurationComponentRegistry.java:173)
> 	at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:1693)
> 	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:88)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.