title: Invalid property 'datasource' of bean class in spring
body: <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" xmlns:aop="http://www.springframework.org/schema/aop"
      xmlns:tx="http://www.springframework.org/schema/tx"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
          http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
          http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"&gt;
  
  
      &lt;bean id="datasource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
      &lt;property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"&gt;&lt;/property&gt;
      &lt;property name="url" value="jdbc:oracle:thin:@localhost:1521:XE"&gt;&lt;/property&gt;
      &lt;property name="username" value="SYSTEM"&gt;&lt;/property&gt;
      &lt;property name="password" value="admin"&gt;&lt;/property&gt;
      &lt;/bean&gt;
      &lt;bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt;
      &lt;property name="datasource" ref="datasource"&gt;&lt;/property&gt;
      &lt;property name="annotatedClasses"&gt;
      &lt;list&gt;
      &lt;value&gt;spring.SpringORM.Student&lt;/value&gt;
      &lt;/list&gt;
      &lt;/property&gt;
      &lt;property name="hibernateProperties"&gt;   
      &lt;props&gt;
      &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.oracl11gDialect&lt;/prop&gt;
      &lt;/props&gt;
      &lt;/property&gt;
      &lt;/bean&gt;
  
  
  
      &lt;bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate"&gt;
      &lt;property name="sessionFactory"  ref="sessionFactory"&gt;&lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"&gt;
      &lt;property name="sessionFactory" ref="sessionFactory"&gt;&lt;/property&gt;
      &lt;/bean&gt;
  
  
      &lt;bean id="studnetDaoImplement" class="spring.SpringORM.StudnetDaoImplement"&gt;
      &lt;constructor-arg ref="hibernateTemplate" /&gt;
      &lt;/bean&gt;
  
          &lt;/beans&gt;
  </code></pre>
  
  <p>I am getting this error</p>
  
  <pre><code>NFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@3b0def13: defining beans [datasource,sessionFactory,hibernateTemplate,transactionManager,studnetDaoImplement]; root of factory hierarchy
  Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [Application-context.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'datasource' of bean class [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean]: Bean property 'datasource' is not writable or has an invalid setter method. Did you mean 'dataSource'?
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1344)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:545)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
      at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:139)
      at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:83)
      at spring.SpringORM.StudentTesting.main(StudentTesting.java:12)
  Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'datasource' of bean class [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean]: Bean property 'datasource' is not writable or has an invalid setter method. Did you mean 'dataSource'?
      at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1012)
      at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:857)
      at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:76)
      at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1341)
      ... 13 more
  </code></pre>