Please show me where I have problem? Here is my project: https://github.com/intrade/inventory I try to enable Spring security using java config and when I try to inject a de
You are trying to autowire your user details service by class, but that can't work, because the spring bean is actually a proxy created around that class (and not an instance of the class). The proxy will however implement all interfaces of the original bean, so injecting by interface is safe.
Exchange this line:
@Autowired
private MyCustomUserDetailsService myCustomUserDetailsService;
for this one:
@Autowired
private UserDetailsService myCustomUserDetailsService;
Read the section on Proxying Mechanisms in the Spring AOP to understand the details.