Sure thing. dataSource.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName">
<value>org.gjt.mm.mysql.Driver</value>
</property>
<property name="maxActive">
<value>100</value>
</property>
<property name="maxIdle">
<value>30</value>
</property>
<property name="maxWait">
<value>100</value>
</property>
<property name="url">
<value>jdbc:mysql://localhost:3306/blah?autoReconnect=true</value>
</property>
<property name="username">
<value>protectThe</value>
</property>
<property name="password">
<value>innocent</value>
</property>
</bean>
</beans>
and myContext.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!-- DAO's -->
<bean id="mileageDao" class="com.something.MileageDaoImpl">
<property name="dataSource"><ref local="dataSource"/></property>
</bean>
....
<!-- Services -->
<bean id="nadaService" class="com.something.ServiceImpl">
<property name="mileageDao"><ref local="mileageDao"/></property>
</bean>
</beans>
So you can see the xml parser is freaking out because theres no bean named dataSource within the myContext.xml file... even though it is being loaded into the spring context from the other file...
-David