|
Hi, Sorry in advance if this is a repeat but I could not see
that in the mail archive. 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 <set-service. 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 =
getOrderedServiceConstructors(serviceClass); 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,
| ||||||||||||||||
- Infinite Recusion Issue When Creating a Service Jean Safar
- RE: Infinite Recusion Issue When Creating a Service James Carman
- Re: Infinite Recusion Issue When Creating a Service Knut Wannheden
- RE: Infinite Recusion Issue When Creating a Servi... Jean Safar
- Re: Infinite Recusion Issue When Creating a S... Knut Wannheden
- Assigning Object from Configuration Derek Brown
- Re: Assigning Object from Configuration Johan Lindquist
- RE: Assigning Object from Configuration James Carman

