java falco后夹器_java - Class doesn't contain matching constructor for autowiring

I have two classes

public abstract class AbstractDAO {

private final MyExecutor myExecutor;

private final Class clazz;

public AbstractDAO(MyExecutor myExecutor, Class clazz) {

this.myExecutor = myExecutor;

this.clazz = clazz;

}

}

and

@Component

public class MyDAOImpl extends AbstractDAO {

private final SessionManager sessionManager;

private final MyExecutor myExecutor;

@Autowired

public MyDAOImpl(SessionManager sessionManager, MyExecutor myExecutor) {

super(myExecutor, Manager.class);

this.sessionManager = sessionManager;

this.myExecutor= myExecutor;

}

}

I got an error at the definition of the abstract class saying that: "Class doesn't contain matching constructor for autowiring".

All I did is added an additional constructor parameter to the constructor of AbstractDAO which is a Class. I need this because I didn't find a way to detect this out from T at run time (stackflow search says there isn't one).

How can I fix this? How can I pass the Class information which can only be determined in the implementation class?c class Example { private final Logger logger; @Autowired public Example(final Logger logger) { this.logger = logger; }} I've found the FactoryBean class, which I've implemented. But the problem is that I cannot get any info

Many thanks

java

spring

dependency-injection

edited Feb 16 '14 at 16:17 asked Feb 16 '14 at 15:39

Kevin 1,469 7 36 60      It is a compile time error. No stack stace. Thanks. –

Kevin Feb 16 '14 at 15:44      You might want to read:

stackoverflow.com/questions/3153546/… and

stackoverflow.com/questions/19414734/spring-autowired-usage –

pedromss Feb 16 '14 at 16:28      Your code, as shown, compiles fine. –

Sotirios Delimanolis Feb 16 '14 at 17:26      It only compiles if I add a @Autowired in the constructor of the abstract class AbstractDAO. Otherwise, it won't. I want to know why it is like this. Many thanks. –

Kevin Feb 16 '14 at 17:28      I think you are misunderstanding what compilation is. Your error is not a compilation error (unless there is something seriously missing from your question). –

Sotirios Delimanolis Feb 16 '14 at 17:38

|

show more comment

1 Answers

1

---Accepted---Accepted---Accepted---

This is a bug in IntelliJ that is fixed in 13.1. http://youtrack.jetbrains.com/issue/IDEA-120977

answered Mar 9 '14 at 18:45

robert_difalco 2,378 1 16 34

|

A_UMBRELLA = ApplicationContextProvider.getApplicationContext().getBean(ParametrosInfraComponent.class) .findByIdParametroLikeAsMap("%UMBRELLA%"); private final HttpConnectionRest conexaoHttp; @Autowired @Qualifier

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值