This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
<bean id = "springQuizMaster" class ="com.services.SpringQuizMaster"></bean>
<bean id = "strutsQuizMaster" class = "com.services.StrutsQuizMaster"></bean>
<bean id = "quizMasterService" class = "com.services.QuizMasterService" init-method = "init" destroy-method = "destroy" autowire="byName">
When I use :
<constructor-arg ref="springQuizMaster"/> instead of autowire attribute it runs perfect
but while using autowiring it fails.
Can anyone help me out?
You can't autowire here without more information because there are two beans that go with that constructor. Spring has no way to know which bean you want injected. That's why it works when you use the constructor.