[ 
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.

Reply via email to