As the exception says, both HibernateModule.contributeValueEncoderSource() and AppModule.contributeValueEncoderSource() are contributing a ValueEncoder for a given type and that's forbidden. Do you really need to provide your own ValueEncoders? Doesn't the Tapestry-Hibernate provided ones suit your needs? If you don need your own ValueEncoders, you can contribute them using the MappedConfiguration.override() method instead of add(). Otherwise, just don't provide your own ones.
On Mon, Jun 17, 2013 at 10:42 PM, Nomen Nomanum <getibi...@outlook.com>wrote: > Hi. :) > I have following case: > Article > - - > - - > Fruits Vegetables > > > Fruits and Vegetables inherits Article, and both Fruits and Vegetables > have same DiscriminatorValue. Now when I try to do some ValueEncoder magic > like in following > public class ArticleEncoder implements ValueEncoder< Article>, > ValueEncoderFactory< Article> { > > private LogicDAO logicDAO; > > @Override > public String toClient(final Article v) { > return String.valueOf(v.getName()); > } > > @Override > public Artikal toValue(String string) { > Article result = new Article(); > result = logicDAO.listSpecificArticle(string); > return result; > } > > @Override > public ValueEncoder< Article> create(Class< Article> type) { > return this; > } > } > > > I get following > HTTP Status 500 - Exception constructing service > 'ValueEncoderSource': Error invoking service contribution method > > org.apache.tapestry5.hibernate.HibernateModule.contributeValueEncoderSource(MappedConfiguration, > boolean, HibernateSessionSource, Session, TypeCoercer, PropertyAccess, > LoggerSource): Service contribution (to service 'ValueEncoderSource') > conflicts with existing contribution (by > com.google.tapestrySection.teamAlpha.services.AppModule.contributeValueEncoderSource(MappedConfiguration, > LogicDAO) (at AppModule.java:1264)). > > Anyone knows how to hack this issue here? :) > -- Thiago