Hi erverybody !!

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> configuration,
@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.

Have you already seen this problem ?

Thanks a lot

Manu

Reply via email to