hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <>
Subject RE: Infinite Recusion Issue When Creating a Service
Date Fri, 04 Nov 2005 01:33:27 GMT


Are you using the primitive service lifecycle model?  





From: Jean Safar [] 
Sent: Thursday, November 03, 2005 5:42 PM
Subject: Infinite Recusion Issue When Creating a Service





Sorry in advance if this is a repeat but I could not see that in the mail


I am experiencing a problem by which HiveMind (version 1.1 and 1.1-beta-3)
will enter into a infinite recursion when creating a service. This
eventually exhausts all the available memory and makes the program unusable.


I have a Service Class MyService implementing the interface IMyService. 


This class has a constructor public MyService (IMyService) {...} as well as
other constructors. 


The service point of my service has no parameters or explicit injection via


When creating the service, it will eventually arrive at a the following test
within the method instantiateCoreServiceInstance in BuildFactoryLogic.


        if (_parameter.getAutowireServices() && parameters.isEmpty())


            return instantiateConstructorAutowiredInstance(serviceClass);



This test will be satisfied and the instantiateConstructorAutowiredInstance
will then be called. 


In it will try and get all the constructors for the given class removing
those not taking interfaces as parameters. 


List serviceConstructorCandidates =


One of this constructor will be the one with IMyService in it. If with bad
luck it comes first in the iteration that follows, the code will try and
call the constructor with parameters which are services attached to the
interfaces of the parameters. 


Since the interface is the very interface of the service I am trying to
build, it will enter the loop and never come back. 


An easy and effective fix might be to disregard constructors with the
interface of the service it is currently trying to build thus avoiding the
loop. I have tried that and it works fine. 


Best Regards, 



jean safar
European Technology Director 


Work: +33172745536
Mobile: +33611507664
Fax: +33172745537


IM: safarje (Skype <skype:safarje?call> /Yahoo)
Professional Profile <> 


 <> Quartet Financial Systems
52 Bd Sebastopol
Paris France



Want a <>  signature like this?


View raw message