Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
5.0.4
-
None
-
5.0.5-SNAPSHOT
Description
The issue is that the ServiceLifecycleSource service is making indirect use of the Alias service for some of its dependencies. Thus the Alias service must be fully instantiated for SLS to be instantiated, but when contributing a service to Alias, the SLS must be instantiated first, to provide the necessary proxy. Need to defer out the creation of the proxy.
Caused by: java.lang.RuntimeException: Error invoking service contribution method org.apache.tapestry.ioc.services.TapestryIOCModule.contributeServiceLifecycleSource(MappedConfiguration, ObjectLocator): Error invoking constructor org.apache.tapestry.ioc.internal.services.PerThreadServiceLifecycle(ThreadCleanupHub, ClassFactory) (at PerThreadServiceLifecycle.java:54) (for service 'ServiceLifecycleSource'): Exception constructing service 'Alias': Construction of service 'Alias' has failed due to recursion: the service depends on itself in some way. Please check org.apache.tapestry.services.TapestryModule.build(Log, String, AliasManager, Collection) (at TapestryModule.java:248) for references to another service that is itself dependent on service 'Alias'.
at org.apache.tapestry.ioc.internal.ContributionDefImpl.invokeMethod(ContributionDefImpl.java:112)
at org.apache.tapestry.ioc.internal.ContributionDefImpl.contribute(ContributionDefImpl.java:73)
at org.apache.tapestry.ioc.internal.RegistryImpl.addToMappedConfiguration(RegistryImpl.java:379)
at org.apache.tapestry.ioc.internal.RegistryImpl.getMappedConfiguration(RegistryImpl.java:332)
at org.apache.tapestry.ioc.internal.ServiceResourcesImpl.getMappedConfiguration(ServiceResourcesImpl.java:97)
at org.apache.tapestry.ioc.internal.AbstractServiceCreator.addMappedConfigurationParameter(AbstractServiceCreator.java:160)
public PerThreadServiceLifecycle(ThreadCleanupHub threadCleanupHub,
@InjectService("ClassFactory")
ClassFactory classFactory)
A temporary fix would be for the ThreadCleanupHub to be injected using @InjectService.