You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by su...@gmx.de on 2009/02/09 23:27:10 UTC
Construction of service 'Alias' has failed due to recursion
hi there!
what's wrong with the following service?
AppModule.java
public static void bind(ServiceBinder binder)
{
binder.bind(DBService.class).scope("singleton");
}
DBService.java
public class DBService {
private Session session;
public DBService(Session session) {
this.session = session;
}
public Session getSession(){
return this.session;
}
..
}
Why does this lead to ?
Caused by: java.lang.IllegalStateException: Construction of service 'Alias' has failed due to recursion: the service depends on itself in some way. Please check org.apache.tapestry5.services.TapestryModule.build(Logger, String, AliasManager, Collection) (at TapestryModule.java:205) for references to another service that is itself dependent on service 'Alias'.
at org.apache.tapestry5.ioc.internal.RecursiveServiceCreationCheckWrapper.createObject(RecursiveServiceCreationCheckWrapper.java:52)
at org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:65)
... 56 more
DBService is supposed to be a service that aggregates all database query methods in one class....
Thanks!
Toby
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Construction of service 'Alias' has failed due to recursion
Posted by Howard Lewis Ship <hl...@gmail.com>.
All I can say for this is ... the 5.1 code tracks whats going on, and
reports it when an exception occur. Makes tracking this stuff down
much easier. You're not making any contribution to Alias?
On Mon, Feb 9, 2009 at 3:59 PM, Thiago H. de Paula Figueiredo
<th...@gmail.com> wrote:
> One situation that can raise that exception is the existence of non-static
> methods in Tapestry-IoC class modules (for example, AppModule). I've had
> this problem once. By the way, it happened for more people in this list too,
> so check the archives. ;)
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Howard M. Lewis Ship
Creator Apache Tapestry and Apache HiveMind
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Construction of service 'Alias' has failed due to recursion
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
One situation that can raise that exception is the existence of non-static
methods in Tapestry-IoC class modules (for example, AppModule). I've had
this problem once. By the way, it happened for more people in this list
too, so check the archives. ;)
--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org