hivemind-user mailing list archives

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

 

Are you using the primitive service lifecycle model?  

 

James

 

  _____  

From: Jean Safar [mailto:jsa@quartetfs.com] 
Sent: Thursday, November 03, 2005 5:42 PM
To: hivemind-user@jakarta.apache.org
Subject: Infinite Recusion Issue When Creating a Service

 

--> 

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, 

 

 


jean safar
European Technology Director 







 

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

 

Email: jsa@quartetfs.com
IM: safarje (Skype <skype:safarje?call> /Yahoo)
Professional Profile <https://www.linkedin.com/e/fps/697532/> 

 

 <http://www.quartetfs.com> Quartet Financial Systems
52 Bd Sebastopol
<http://maps.google.com/maps?q=52+Bd+Sebastopol%2CParis%2CFrance&hl=en> 
Paris France

 


 <skype:safarje?call> 

Want a <https://www.linkedin.com/e/sig/697532/>  signature like this?

 


Mime
View raw message