The error says it all: You already have a service implementing SaltSource (it gets contributed automatically by the tapestry-spring-security module). If you want to override it, contribute to the AliasOverrides service:

    public static void 
contributeAliasOverrides(Configuration<AliasContribution<?>> configuration)
    {
        SaltSourceService saltSource = new SaltSourceService() {
                        public Object getSalt(UserDetails user) {
                                return null;
                        }
        };
        
        configuration.add(AliasContribution.create(SaltSourceService.class, 
saltSource));
    }

cheers,

Uli
bongosdude schrieb:
I Just got this error and I could not figure it out yet.

java.lang.RuntimeException: Service id 'SaltSource' has already been defined
by
nu.localhost.tapestry5.springsecurity.services.SecurityModule.buildSaltSource(String)
(at SecurityModule.java:121) and may not be redefined by
nu.localhost.tapestry.acegi.services.SecurityModule.buildSaltSource(String)
(at SecurityModule.java:115). You should rename one of the service builder
methods.
        at
org.apache.tapestry5.ioc.internal.RegistryImpl.<init>(RegistryImpl.java:170)
        at 
org.apache.tapestry5.ioc.RegistryBuilder.build(RegistryBuilder.java:168)

here is my code in AppModule.java

    public static void bind(ServiceBinder binder)
    {
        binder.bind(SaltSourceService.class,
PlaintextSaltSourceImpl.class).withId("PlaintextSaltSource"); }

    public static void
contributeProviderManager(OrderedConfiguration<AuthenticationProvider>
configuration,
            @InjectService("DaoAuthenticationProvider")
AuthenticationProvider daoAuthenticationProvider) {
        configuration.add("daoAuthenticationProvider",
daoAuthenticationProvider);
    }


and my PlaintextSaltSourceImpl.java
import org.springframework.security.userdetails.UserDetails;
import nu.localhost.tapestry5.springsecurity.services.SaltSourceService;
public class PlaintextSaltSourceImpl implements SaltSourceService {

        public Object getSalt(UserDetails user) {
                return null;
        }

}




-----
B Amigo:super:


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to