[
https://issues.apache.org/jira/browse/TAPESTRY-1596?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Howard M. Lewis Ship closed TAPESTRY-1596.
------------------------------------------
Resolution: Fixed
Fix Version/s: 5.0.5
Defused the dependency by deferreing the resolution of the ServiceLifecycle
until the service is being realized (rather than when the proxy is being
created).
> Contributing a service to the Alias service configuration fails if the
> service uses a non-standard scope, such as perthread
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: TAPESTRY-1596
> URL: https://issues.apache.org/jira/browse/TAPESTRY-1596
> Project: Tapestry
> Issue Type: Bug
> Components: tapestry-core, tapestry-ioc
> Affects Versions: 5.0.4
> Environment: 5.0.5-SNAPSHOT
> Reporter: Howard M. Lewis Ship
> Assignee: Howard M. Lewis Ship
> Fix For: 5.0.5
>
>
> 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)
> {
> _threadCleanupHub = threadCleanupHub;
> _classFactory = classFactory;
> }
> A temporary fix would be for the ThreadCleanupHub to be injected using
> @InjectService.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]