Ok, i found the problem. To inject the service u have to use: @Inject @Autowired private Service MyService;
As always the problem was between the screen and chair :) On Wed, Oct 28, 2009 at 1:06 AM, Juan E. Maya <maya.j...@gmail.com> wrote: > Hi Hennig, did u manage to resolve this problem? > > i am having the same issue. I just can't inject any tapestry beans > inside Spring. I using tapestry 5.1.0.5 and spring 2.6. Without > compatible mode but the services just don't get injected :( > > On Fri, Jul 10, 2009 at 3:00 PM, Henning Petersen > <henning.peter...@daenen4.de> wrote: >> Hi everybody, >> >> I'm trying to inject two services from Tapestry-Spring-Security into a >> Spring bean, using Tapestry 5.1.0.5 and Spring 2.5.6-SEC01. >> >> The way I think this should work is this: >> >> public class PasswordChangeServiceImpl implements PasswordChangeService { >> >> �...@inject >> private SaltSourceService saltSource; >> �...@inject >> private PasswordEncoder passwordEncoder; >> >> ... >> >> private String createPasswordHash(String plainTextPass) { >> UserDetails userDetails = ... >> Object salt = this.saltSource.getSalt(userDetails); >> return this.passwordEncoder.encodePassword(plainTextPass, >> salt); >> } >> >> } >> >> and >> >> <bean id="passwordChangeService" class="PasswordChangeServiceImpl"> >> ...(other dependencies)... >> </bean> >> >> I inject the service instance into my page using the @Inject annotation: >> >> public class UserProfile { >> �...@inject private PasswordChangeService passwordChangeService; >> ... >> } >> >> The service is properly configured as far as the dependencies handled by >> Spring are concerned, but the two services that I'd like to be injected from >> Tapestry's IoC newer make it into the instance, and I get a >> NullPointerException when they are accessed. >> >> Both SaltSourceService and PasswordEncoder are defined and visible on the >> service status page, and they work like a charm when injected into >> components directly. I'm not using 5.0 compatibility mode. >> >> Does anyone have an idea what I am missing? >> >> Thanks >> Henning >> >> >> --------------------------------------------------------------------- >> 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