This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

While running TestJava.java file I am getting the following error message:

Code:

Result Value
java.lang.IllegalArgumentException: No SessionFactory specified
at org.springframework.util.Assert.notNull(Assert.java:90)
at org.springframework.orm.hibernate3.SessionFactoryUtils.doGetSession(SessionFactoryUtils.java:293)
at org.springframework.orm.hibernate3.SessionFactoryUtils.getSession(SessionFactoryUtils.java:194)
at jeevan.spring.dao.BaseDAO.openSession(BaseDAO.java:13)
at jeevan.spring.dao.BaseDAO.getQuery(BaseDAO.java:18)
at jeevan.spring.dao.impl.FnuDAOImpl.getStatus(FnuDAOImpl.java:28)
at jeevan.TestJava.main(TestJava.java:15)
Exception in thread "main"

In your test class you are just instantiating a FnuDAOImpl, it doesn't get injected with the sessionfactory and hibernate template. You need to create a ApplicationContext and retrieve a instance from that.

Comment

log4j:WARN No appenders could be found for logger (org.springframework.beans.factory.xml.XmlBeanDefinitionReader).
log4j:WARN Please initialize the log4j system properly.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'oracleDS' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'hibernate.connection.driver_class' of bean class [org.springframework.jdbc.datasource.DriverManagerDataSource]: Nested property in path 'hibernate.connection.driver_class' does not exist; nested exception is org.springframework.beans.NotReadablePropertyException: Invalid property 'hibernate' of bean class [org.springframework.jdbc.datasource.DriverManagerDataSource]: Bean property 'hibernate' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
org.springframework.beans.NotWritablePropertyException: Invalid property 'hibernate.connection.driver_class' of bean class [org.springframework.jdbc.datasource.DriverManagerDataSource]: Nested property in path 'hibernate.connection.driver_class' does not exist; nested exception is org.springframework.beans.NotReadablePropertyException: Invalid property 'hibernate' of bean class [org.springframework.jdbc.datasource.DriverManagerDataSource]: Bean property 'hibernate' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
org.springframework.beans.NotReadablePropertyException: Invalid property 'hibernate' of bean class [org.springframework.jdbc.datasource.DriverManagerDataSource]: Bean property 'hibernate' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:634)
at org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(BeanWrapperImpl.java:535)
at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:513)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:709)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:844)
at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:871)
at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:860)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:926)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:727)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:336)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:312)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:80)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:65)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:56)
at jeevan.TestJava.main(TestJava.java:17)
Exception in thread "main"