posted 14 years ago
Hi,
I have a standalone executable jar which uses spring injection through test1-context.xml. The dependency code is as below:
<bean id="TestDAO" class="com.test.dao.TestDAO">
<property name="dbResourceHandler"><ref bean="dbResourceHandler" /></property>
</bean>
here dbResourceHandler is the injected bean property, which lies in a different jar file. I have the dbUtils.jar in my classpath and i import context file using the below text:
<import resource="classpath*:com/**/resource-context.xml"/>
The entry of the dbResourceHandler in dbUtil jar is as below:
<bean id="dbResourceHandler" class="com.test.dbutils.DBResourceHandler">
<property name="dataSourceUK"><ref bean="dataSourceUK" /></property>
</bean>
It seems that the dbResourceHandler is not being injected properly and the code gives error:
ClassCastException: com.test.dbutils.DBResourceHandler not found.
Regards,
Paresh
Thanks.<br />Paresh Doshi<br />SCJP 1.4