title: Correct version of Spring and Hibernate and required dependencies...Exception due to dependencies
body: <p>Since three days i am trying to get my Spring-Hibernate programs run. i had really tough time finding the involved dependencies due to version difference between hibernate2 and hibernate3.
  Finally i was able to run program with following set of dependencies</p>
  
  <ul>
  <li>cglib-nodep-2.1_3.jar</li>
  <li>commons-collections.jar</li>
  <li>commons-dbcp.jar </li>
  <li>commons-pool.jar</li>
  <li>commons-logging.jar </li>
  <li>dom4j-1.4.jar</li>
  <li>ehcache-1.6.0-beta1.jar</li>
  <li>hibernate-3.1.3.jar </li>
  <li>hsqldb.jar</li>
  <li>jta.jar log4j-1.2.9.jar</li>
  <li>mysql-connector-java-5.0.8-bin.jar</li>
  <li>org.springframework.orm-3.1.0.M1.jar</li>
  <li>org.springframework.transaction-3.1.0.M1.jar</li>
  <li>spring-2.5.6.jar</li>
  <li>spring-beans-2.0.4.jar</li>
  </ul>
  
  <p>now after two days of efforts when i was able to manage the above mentioned dependencies i tried building similar program but it is throwing following error.I tried online for solution but the solution which i found there is not correct version of spring and hibernate ...Can any one tell me correct cause of exception and also correct version of the Spring and hibernate</p>
  
  <hr>
  
  <pre><code>Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myRecordDAO' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'hibernateTemplate' while setting bean property 'hibernateTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeException
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
      at java.security.AccessController.doPrivileged(Native Method)
  </code></pre>
  
  <hr>
  
  <p>I am also adding my application context.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.0.xsd"&gt;
  
      &lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"&gt;
          &lt;property name="driverClassName" value="com.mysql.jdbc.Driver"/&gt;
          &lt;property name="url" value="jdbc:mysql://localhost:3306/subhash"/&gt;
          &lt;property name="username" value="root"/&gt;
          &lt;property name="password" value=""&gt;&lt;/property&gt;
      &lt;/bean&gt;
  
  
      &lt;bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"&gt;
          &lt;property name="dataSource"&gt;&lt;ref local="dataSource"/&gt;&lt;/property&gt;
          &lt;property name="mappingResources"&gt;
              &lt;list&gt;
                  &lt;value&gt;MyRecord.hbm.xml&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.HSQLDialect&lt;/prop&gt;
                  &lt;prop key="show_sql"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.hbm2ddl.auto"&gt;create&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"&gt;&lt;ref local="sessionFactory"/&gt;&lt;/property&gt;
      &lt;/bean&gt;
      &lt;bean id="myRecordDAO" class="com.shoesobjects.MyRecordDAOHibernateWithSpring"&gt;
          &lt;property name="hibernateTemplate"&gt;&lt;ref local="hibernateTemplate"/&gt;&lt;/property&gt;
      &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>