You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "David Savage (JIRA)" <ji...@apache.org> on 2009/10/02 18:45:23 UTC

[jira] Created: (FELIX-1686) Missing activate or deativate methods show up as Error in LogService

Missing activate or deativate methods show up as Error in LogService
--------------------------------------------------------------------

                 Key: FELIX-1686
                 URL: https://issues.apache.org/jira/browse/FELIX-1686
             Project: Felix
          Issue Type: Improvement
          Components: Declarative Services (SCR)
         Environment: org.apache.felix.scr-1.0.9-SNAPSHOT
            Reporter: David Savage
            Priority: Trivial


If no activate or deactivate methods are registered in the xml this is not an error as activate and deactivate methods are optional.

However complexity arises if user explicitly sets an activate or deactivate methods in xml as in this case it probably is an error if the method is not found.

Thought it worth registering this issue as it caused me some confusion when I saw it and I needed to go digging though the code to figure out that this was in fact harmless.

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


[jira] Closed: (FELIX-1686) Missing activate or deativate methods show up as Error in LogService

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

Felix Meschberger closed FELIX-1686.
------------------------------------


SCR 1.2.0 has been released. Close all issues.

> Missing activate or deativate methods show up as Error in LogService
> --------------------------------------------------------------------
>
>                 Key: FELIX-1686
>                 URL: https://issues.apache.org/jira/browse/FELIX-1686
>             Project: Felix
>          Issue Type: Improvement
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.2.0
>         Environment: org.apache.felix.scr-1.0.9-SNAPSHOT
>            Reporter: David Savage
>            Assignee: Felix Meschberger
>            Priority: Trivial
>             Fix For: scr-1.2.0
>
>
> If no activate or deactivate methods are registered in the xml this is not an error as activate and deactivate methods are optional.
> However complexity arises if user explicitly sets an activate or deactivate methods in xml as in this case it probably is an error if the method is not found.
> Thought it worth registering this issue as it caused me some confusion when I saw it and I needed to go digging though the code to figure out that this was in fact harmless.

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


[jira] Commented: (FELIX-1686) Missing activate or deativate methods show up as Error in LogService

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

Felix Meschberger commented on FELIX-1686:
------------------------------------------

> better to shout loudly and not act at all vs come up in a potentially broken state

100% agreed

> Missing activate or deativate methods show up as Error in LogService
> --------------------------------------------------------------------
>
>                 Key: FELIX-1686
>                 URL: https://issues.apache.org/jira/browse/FELIX-1686
>             Project: Felix
>          Issue Type: Improvement
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.2.0
>         Environment: org.apache.felix.scr-1.0.9-SNAPSHOT
>            Reporter: David Savage
>            Assignee: Felix Meschberger
>            Priority: Trivial
>             Fix For: scr-1.2.0
>
>
> If no activate or deactivate methods are registered in the xml this is not an error as activate and deactivate methods are optional.
> However complexity arises if user explicitly sets an activate or deactivate methods in xml as in this case it probably is an error if the method is not found.
> Thought it worth registering this issue as it caused me some confusion when I saw it and I needed to go digging though the code to figure out that this was in fact harmless.

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


[jira] Commented: (FELIX-1686) Missing activate or deativate methods show up as Error in LogService

Posted by "David Savage (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1686?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12761956#action_12761956 ] 

David Savage commented on FELIX-1686:
-------------------------------------

Yep debug sounds like the right level if the activate method is not specified and none is present. 

Also spec behaviour sounds correct in case absence of methods when configured in xml as this likely indicates an inconsistency and launching the component could result in "bad things" in this case - better to shout loudly and not act at all vs come up in a potentially broken state?

> Missing activate or deativate methods show up as Error in LogService
> --------------------------------------------------------------------
>
>                 Key: FELIX-1686
>                 URL: https://issues.apache.org/jira/browse/FELIX-1686
>             Project: Felix
>          Issue Type: Improvement
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.2.0
>         Environment: org.apache.felix.scr-1.0.9-SNAPSHOT
>            Reporter: David Savage
>            Assignee: Felix Meschberger
>            Priority: Trivial
>             Fix For: scr-1.2.0
>
>
> If no activate or deactivate methods are registered in the xml this is not an error as activate and deactivate methods are optional.
> However complexity arises if user explicitly sets an activate or deactivate methods in xml as in this case it probably is an error if the method is not found.
> Thought it worth registering this issue as it caused me some confusion when I saw it and I needed to go digging though the code to figure out that this was in fact harmless.

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


[jira] Commented: (FELIX-1686) Missing activate or deativate methods show up as Error in LogService

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

Felix Meschberger commented on FELIX-1686:
------------------------------------------

Actually, the spec prescribes the proposed behaviour and goes a step further:

>From 112.5.8, Activate Method:

    If the activate attribute is specified and no suitable method is located, SCR must
    log an error message with the Log Service, if present, and the component
    configuration is not activated.

Likewise for the deactivate method in 112.5.14, Deactivate Method.

> Missing activate or deativate methods show up as Error in LogService
> --------------------------------------------------------------------
>
>                 Key: FELIX-1686
>                 URL: https://issues.apache.org/jira/browse/FELIX-1686
>             Project: Felix
>          Issue Type: Improvement
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.2.0
>         Environment: org.apache.felix.scr-1.0.9-SNAPSHOT
>            Reporter: David Savage
>            Assignee: Felix Meschberger
>            Priority: Trivial
>             Fix For: scr-1.2.0
>
>
> If no activate or deactivate methods are registered in the xml this is not an error as activate and deactivate methods are optional.
> However complexity arises if user explicitly sets an activate or deactivate methods in xml as in this case it probably is an error if the method is not found.
> Thought it worth registering this issue as it caused me some confusion when I saw it and I needed to go digging though the code to figure out that this was in fact harmless.

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


[jira] Resolved: (FELIX-1686) Missing activate or deativate methods show up as Error in LogService

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

Felix Meschberger resolved FELIX-1686.
--------------------------------------

    Resolution: Fixed

Slightly redone getting the method returning null instead of throwing NoSuchMethodException BaseMethod.getMethod cannot actually find a method (in Rev. 830885).

I think this issue is ok now and can be resolved (and in fact I cannot understand my last comment for reopening the issue anymore :-( )

> Missing activate or deativate methods show up as Error in LogService
> --------------------------------------------------------------------
>
>                 Key: FELIX-1686
>                 URL: https://issues.apache.org/jira/browse/FELIX-1686
>             Project: Felix
>          Issue Type: Improvement
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.2.0
>         Environment: org.apache.felix.scr-1.0.9-SNAPSHOT
>            Reporter: David Savage
>            Assignee: Felix Meschberger
>            Priority: Trivial
>             Fix For: scr-1.2.0
>
>
> If no activate or deactivate methods are registered in the xml this is not an error as activate and deactivate methods are optional.
> However complexity arises if user explicitly sets an activate or deactivate methods in xml as in this case it probably is an error if the method is not found.
> Thought it worth registering this issue as it caused me some confusion when I saw it and I needed to go digging though the code to figure out that this was in fact harmless.

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


[jira] Updated: (FELIX-1686) Missing activate or deativate methods show up as Error in LogService

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

Felix Meschberger updated FELIX-1686:
-------------------------------------

    Affects Version/s: scr-1.2.0
        Fix Version/s: scr-1.2.0
             Assignee: Felix Meschberger

Setting affected version (only occurrs in current trunk, code has been added after last release) and target version.

> Missing activate or deativate methods show up as Error in LogService
> --------------------------------------------------------------------
>
>                 Key: FELIX-1686
>                 URL: https://issues.apache.org/jira/browse/FELIX-1686
>             Project: Felix
>          Issue Type: Improvement
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.2.0
>         Environment: org.apache.felix.scr-1.0.9-SNAPSHOT
>            Reporter: David Savage
>            Assignee: Felix Meschberger
>            Priority: Trivial
>             Fix For: scr-1.2.0
>
>
> If no activate or deactivate methods are registered in the xml this is not an error as activate and deactivate methods are optional.
> However complexity arises if user explicitly sets an activate or deactivate methods in xml as in this case it probably is an error if the method is not found.
> Thought it worth registering this issue as it caused me some confusion when I saw it and I needed to go digging though the code to figure out that this was in fact harmless.

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


[jira] Commented: (FELIX-1686) Missing activate or deativate methods show up as Error in LogService

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

Felix Meschberger commented on FELIX-1686:
------------------------------------------

Correct, listing the methods is optional and no message is logged if the activate or deactivate method declaration is missing. A WARN message is logged if the activate or deactivate method is configured in a V 1.0 descriptor (and the configuration is ignored).

But an ERROR message is logged at the time the component should actually be activated or deactivated if such a method (regardless of whether configured or not) is not existing. And this is, I agree, very, very confusing.

I noted this behaviour, too, in fact, and was planning on fixing this in the next round of working on the bundle. So a big thanks to reporting it.

This is what I am looking into doing:

   * If an activate/deactivate method is not configured, a missing method is ignored (at most a debug message about it missing)
   * If a method is configured, log a warning about the method missing (maybe informing that the method is declared but missing)

WDYT ?

> Missing activate or deativate methods show up as Error in LogService
> --------------------------------------------------------------------
>
>                 Key: FELIX-1686
>                 URL: https://issues.apache.org/jira/browse/FELIX-1686
>             Project: Felix
>          Issue Type: Improvement
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.2.0
>         Environment: org.apache.felix.scr-1.0.9-SNAPSHOT
>            Reporter: David Savage
>            Assignee: Felix Meschberger
>            Priority: Trivial
>             Fix For: scr-1.2.0
>
>
> If no activate or deactivate methods are registered in the xml this is not an error as activate and deactivate methods are optional.
> However complexity arises if user explicitly sets an activate or deactivate methods in xml as in this case it probably is an error if the method is not found.
> Thought it worth registering this issue as it caused me some confusion when I saw it and I needed to go digging though the code to figure out that this was in fact harmless.

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