title: Invalid bean definition with name 'dataSource' defined in class path resource [spring/database/DataSource.xml]
body: <p>Im trying to create an application that access a sql server database using Spring, Maven and Hibernate. When i try to run the application im getting the following error:</p>
  
  <pre><code>Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'dataSource' defined in class path resource [spring/database/DataSource.xml]: Could not resolve placeholder 'jdbc.driverClassName'
  </code></pre>
  
  <p>Here are my classes</p>
  
  <p>DataSoucre.xml</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"&gt;
  
  &lt;bean 
  class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;
  &lt;property name="location"&gt;
      &lt;value&gt;/properties/database.properties&lt;/value&gt;
  &lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;bean id="dataSource" 
       class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
  &lt;property name="driverClassName" value="${jdbc.driverClassName}" /&gt;
  &lt;property name="url" value="${jdbc.url}" /&gt;
  &lt;property name="username" value="${jdbc.username}" /&gt;
  &lt;property name="password" value="${jdbc.password}" /&gt;
  &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>Hibernate.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"&gt;
  
  &lt;!-- Hibernate session factory --&gt;
  &lt;bean id="sessionFactory" 
  class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt;
  &lt;property name="dataSource"&gt;
    &lt;ref bean="dataSource"/&gt;
  &lt;/property&gt;
  
  &lt;property name="hibernateProperties"&gt;
     &lt;props&gt;
       &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/prop&gt;
       &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
     &lt;/props&gt;
  &lt;/property&gt;
  
  &lt;property name="annotatedClasses"&gt;
  &lt;list&gt;
      &lt;value&gt;com.fexco.helloworld.web.model.Customer&lt;/value&gt;
  &lt;/list&gt;
  &lt;/property&gt;
  
  &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>And database.properties</p>
  
  <pre><code>database.driverClassName=net.sourceforge.jtds.jdbc.Driver
  database.url=jdbc:jtds:sqlserver://localhost:1433;databaseName=Customer
  database.username=*****
  database.password=*****
  </code></pre>
  
  <p>(I have blocked the username and passwords just for here), i also have a BeanLocation.xml as well but shouldnt really need to post that up.</p>
  
  <p>Does anyone know how to solve this, its driving me crazy!
  Thanks </p>