tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel DEMEY (Updated) (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (TAP5-1850) Impossible to override the ComponentMessagesSource service, by using the ServiceOverride service
Date Fri, 17 Feb 2012 09:09:59 GMT

     [ https://issues.apache.org/jira/browse/TAP5-1850?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Emmanuel DEMEY updated TAP5-1850:

    Attachment: tapestry.zip
> Impossible to override the ComponentMessagesSource service, by using the ServiceOverride
> ------------------------------------------------------------------------------------------------
>                 Key: TAP5-1850
>                 URL: https://issues.apache.org/jira/browse/TAP5-1850
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.3
>            Reporter: Emmanuel DEMEY
>            Priority: Blocker
>         Attachments: tapestry.zip
> I am working in the migration of one of our Components library : Tapestry 5.2.6 to 5.3,
and I have a problem with the ServiceOverride service. 
> I would like to override the default implementation of the ComponentMessagesSource service.
 So first, I added this new implementation  by using the ServiceBinder : 
> public static void bind(ServiceBinder binder) {
>   binder.bind(ComponentMessagesSource.class, TestMessageSource.class).withId("test");
> }
> And after, I contributed to the ServiceOverride service, in order to specify the default
implementation of the ComponentMessagesSource interface : 
> public static void contributeServiceOverride(MappedConfiguration<Class, Object>
> @Local ComponentMessagesSource override) {
>     configuration.add(ComponentMessagesSource.class, override);
> }
> But when I jetty:run my application, I have got this message error : 
> Render queue error in BeginRender[core/PropertyEditBlocks:numberfield]: Failure reading
parameter 'translate' of component core/PropertyEditBlocks:numberfield: Exception constructing
service 'FieldTranslatorSource': Service interface org.apache.tapestry5.services.messages.ComponentMessagesSource
is matched by 2 services: ComponentMessagesSource, Test. Automatic dependency resolution requires
that exactly one service implement the interface.
> So, I also checked the implementation of the MasterObjectProviderImpl, and I think Tapestry
do not find the right ObjectProvider for my interface. 
> Here is the email sent to me by Howard : 
> There is a definite bug here, and it is related to
> ComponentMessagesSource ... or, more specifically,
> ApplicationMessageCatalogObjectProvider (which is what allows services
> to inject a Messages instance and get a localized version of the
> application messages). ObjectProviders, contributed to the
> MasterObjectProvider service, are part of the general injection
> infrastructure, and thus have the be very tricky to prevent unintended
> dependency loops. Even so, it should be possible to fix this with a
> little recoding
> Thanks 
> Manu

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message