Yes, I've tried using contributeServiceOverride and this way it never works.
The problem is that the SecurityModule create itself a SaltSourceService it needs after for other service initialisation. I need to create the service first, then the SecurityModule fails to register its service, and correctly use my service for its other services init. Btw, The tapestry-security module I use doesn't register a service, but contribute an alias. But I must admin that i don't fully understand how Tapestry IOC works, so I don't know what is the difference and if that matters. On Thu, 6 May 2010 11:07:58 +0200, Robin Komiwes <odiss...@gmail.com> wrote: > Not sure to really understand what your problem is , but have you tried > service override? > > On Thu, May 6, 2010 at 11:02 AM, Nicolas Bouillon <nico...@bouil.org> > wrote: > >> Hi, >> >> I got a problem using tapestry-spring-security ( >> http://www.localhost.nu/java/tapestry-spring-security/ ) >> >> I have to override the SaltSourceService because my password database >> doesn't use any Salt. >> >> I have added this code to my AppModule : >> >> public static void contributeAlias( >> Configuration<AliasContribution<?>> configuration) { >> configuration.add(AliasContribution.create(PasswordEncoder.class, >> new Md5PasswordEncoder())); >> configuration.add(AliasContribution.create(SaltSourceService.class, >> new SaltSourceService() { >> public Object getSalt(UserDetails user) { >> return ""; >> } >> })); >> } >> >> >> The SaltSourceService seems to be set this way in the SecurityModule >> class >> from tapestry-spring-security : >> >> public static void contributeAlias( >> @SpringSecurityServices SaltSourceService saltSource, >> @SpringSecurityServices >> UsernamePasswordAuthenticationProcessingFilter >> authenticationProcessingFilter, >> Configuration<AliasContribution<?>> configuration ) { >> >> configuration.add( AliasContribution.create( >> SaltSourceService.class, saltSource ) ); >> configuration.add( AliasContribution.create( >> UsernamePasswordAuthenticationProcessingFilter.class, >> authenticationProcessingFilter ) ); >> } >> >> @Marker( SpringSecurityServices.class ) >> public static SaltSourceService buildSaltSource( >> @Inject @Value( "${spring-security.password.salt}" ) final >> String salt ) throws Exception { >> >> SaltSourceImpl saltSource = new SaltSourceImpl(); >> saltSource.setSystemWideSalt( salt ); >> saltSource.afterPropertiesSet(); >> return saltSource; >> } >> >> >> The problem is, from one run to another, the initialisation order is >> maybe >> different, and then my SaltSourceService is not used because my AppModule >> alias conflics withe the existing one : >> >> org.apache.tapestry5.services.TapestryModule.Alias - Contribution >> tapestry.services.appmodul...@fb0c124 (for type >> nu.localhost.tapestry5.springsecurity.services.SaltSourceService) >> conflicts >> with existing contribution <Proxy for >> >> SaltSource(nu.localhost.tapestry5.springsecurity.services.SaltSourceService)> >> and has been ignored. >> >> But if i stop and run again, it may work because my alias is maybuild >> built >> first : >> >> org.apache.tapestry5.services.TapestryModule.Alias - Contribution <Proxy >> for >> >> SaltSource(nu.localhost.tapestry5.springsecurity.services.SaltSourceService)> >> (for type >> nu.localhost.tapestry5.springsecurity.services.SaltSourceService) >> conflicts with existing contribution >> tapestry.services.appmodul...@7333fb54 >> and has been ignored. >> >> Is there any possiblity to force Tapestry to use my version of the >> service >> ? >> >> Thanks. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org