java - Reference "auto detected" bean in Spring's context -
i configured spring auto-detect daos using
<context:component-scan base-package="com.mycomp.app" /> <tx:annotation-driven />. @repository("transactiondao") public class transactiondao { ... }
now i'm configuring manually in context bean references one.
<property name="schedulercontextasmap"> <map> <entry key="transactiondao" value-ref="transactiondao" /> </map> </property>
now spring's complaining:
caused by: org.springframework.beans.factory.nosuchbeandefinitionexception: no bean named 'transactiondao' defined
is possible reference auto detected bean inside context?
is possible reference auto detected bean inside context?
yes possible.
in order see why transactiondao bean not found, can verify following things:
transactiondao should in classpath , lies in sub-package of com.mycomp.app
if step-1 there, run application logger level org.springframework set debug , can see in startup logs of spring beans got initialized.
Comments
Post a Comment