I am making a simple spring application. I already programed this on my other computer and decided to do it again from scratch to really commit it into memory. However my properties file for some reason is not in the class path. I right clicked the properties file and selected "copy qualified name" in eclipse to get the files path. However it is saying the file does not exsist and I find this very weird because I looked at my working example and it is in the same folder "target" and works fine.
When I click "copy qualified name" I get /DatabaseSpringframework/target/jdbc.properties I took away /DatabaseSpringframework/ and left the target/jdbc.properties and still the same error. Here is my xml file...
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://ift.tt/GArMu6"
xmlns:xsi="http://ift.tt/ra1lAU"
xmlns:context="http://ift.tt/GArMu7"
xmlns:tx="http://ift.tt/OGfeU2"
xsi:schemaLocation="http://ift.tt/GArMu6
http://ift.tt/1jdM0fG
http://ift.tt/GArMu7
http://ift.tt/1tY3uA9
http://ift.tt/OGfeU2
http://ift.tt/UJ63uf">
<context:component-scan base-package="com.learntoprogram"></context:component-
scan>
<context:property-placeholder location="target/jdbc.properties" />
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="username" value="${jdbc.username}"></property>
<property name="url" value="${jdbc.url}"></property>
<property name="driverClassName" value="${jdbc.driver}"></property>
</bean>
<tx:annotation-driven />
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
</bean>
</beans>
Aucun commentaire:
Enregistrer un commentaire