I have what seems to be a simple problem, as stated in the title. Here is the kind of class I have :
public class Foo {
@Autowired
public Foo(@Qualifier(
I had this same problem and was inspired by @rembisz's answer. That answer didn't work on my version of Spring (4.1.3). When I checked the SpEL documentation on bean references, I found a different SpEL syntax to express bean references in autowired values that worked for me - @beanname
. As such, the following code worked for me:
public class Foo {
@Autowired
public Foo(@Value("#{@bar}") Set bar) {
// ...
}
}