I'm just trying to test simple CRUD using Spring,Hibernate,Tomcat,MySQL - without any success so far.
Classes that extend HibernateDAOSupport have NPEs on calls such as: getHibernateTemplate().save(pojoObj) and this.getSesssionFactory is always null.
On app/tomcat start-up, the datasource (through JNDI) is being found as far as I can tell: INFO: RDBMS: MySQL, version: 5.0.18-nt Apr 9, 2006 3:43:11 PM org.hibernate.cfg.SettingsFactory buildSettings INFO: JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.12
in my applicationContext.xml: <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName"> <value>java:/comp/env/jdbc/amadeus</value> </property> </bean>
bean config for class extending HibernateDAOSupport: <bean name="schoolAdminMgr" class="com.overture.amadeus.service.HibSchoolAdminMgr"> <property name="sessionFactory"> <ref local="sessionFactory"/> </property> </bean>
mysql driver, commons-dbcp jars copied to tomcat's common/lib folder.
The only symptom I'm seeing is the NPE and null sessionFactory in the running web-app.
I don't know where to focus my attention now on troubleshooting this, any suggestions are much appreciated. I suspect it's probably still something with Tomcat and the datasource...but have exhausted all ideas to try.