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

Xander Uiterlinden commented on FELIX-2816:
-------------------------------------------

This is most likely caused by overlapping init methods. One for the servlet 
init and one for the component lifecycle callback method. It can be resolved by 
specifying another name for the init callback for the component lifecycle by 
using the Component.setCallbacks method.
                
> dependency manager calls init() twice
> -------------------------------------
>
>                 Key: FELIX-2816
>                 URL: https://issues.apache.org/jira/browse/FELIX-2816
>             Project: Felix
>          Issue Type: Bug
>          Components: Dependency Manager
>            Reporter: Derek Baum
>
> Log messages are placed at  the beginning of the component lifecycle methods 
> (init, start, stop, destroy).
> The number is the hashCode, which shows that init() is called twice on the 
> same Object, without intervening stop() or destroy():
> [Debug] [   ] MyServlet 1397120162 init: update=60
> [Debug] [   ] MyServlet 1397120162 start: endpoint=/myservlet period=60 
> history=null
> [Debug] [   ] MyServlet 1397120162 init: update=60
> [Debug] [   ] MyServlet add: gx2
> [Debug] [   ] MyServlet add: denzil
> The component is created as follows:
>               manager.add(createComponent()
>                               .setImplementation(MyServlet.class)
>                               .add(createConfigurationDependency()
>                                               .setPropagate(true)
>                                               .setPid(PID))
>                   .add(createServiceDependency()
>                               
> .setService(HttpService.class).setRequired(true))
>                   .add(createServiceDependency()
>                               .setService(UserAdmin.class).setRequired(true))
>                               .add(createServiceDependency()
>                                               
> .setService(MyStateStore.class).setRequired(false)
>                                               .setCallbacks("addStore", 
> "removeStore"))
>                               .add(createServiceDependency()
>                                               
> .setService(HistoryService.class).setRequired(false))
>                               .add(createServiceDependency()
>                                               
> .setService(LogService.class).setRequired(false))
>               );

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to