Bean creation exception, NoClassDefFoundError: org/hibernate/engine/query/sql/NativeSQLQueryReturn

557 views Asked by At

I am getting below error :

Error creating bean with name 'voteController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.mindtree.service.VoteService com.mindtree.controller.VoteController.voteService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'voteServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.mindtree.dao.VoteDao com.mindtree.serviceImpl.VoteServiceImpl.voteDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'voteDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.springframework.orm.hibernate3.HibernateTemplate com.mindtree.daoImpl.VoteDaoImpl.hibernateTemplate; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/engine/query/sql/NativeSQLQueryReturn

1

There are 1 answers

1
dunni On

You have to make sure, that all dependencies are packaged when you deploy your application. Check your build script.