This week's book giveaway is in the Testing forum.
We're giving away four copies of Data Structures the Fun Way: An Amusing Adventure with Coffee-Filled Examples and have Jeremy Kubica on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Error: Error registering bean with name 'transactionManager'

Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am getting the following error:

Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'transactionManager' defined in class path resource [applicationContext.xml]: Class that bean class [org.springframework.orm.hibernate.HibernateTransactionManager] depends on not found; nested exception is java.lang.NoClassDefFoundError: net/sf/hibernate/HibernateException
java.lang.NoClassDefFoundError: net/sf/hibernate/HibernateException



package com.x.pmo.test;

import org.springframework.context.ApplicationContext;

import com.x.pmo.dao.ProjectDAO;
import com.x.pmo.vo.Project;

public class Test {
private ApplicationContext ctx = null;
private Project project = null;
private ProjectDAO dao = null;
String path = "applicationContext.xml";

public static void main(String[] args) {

Test test = new Test();

public void test() {
ctx = new ClassPathXmlApplicationContext(path);
dao = (ProjectDAO) ctx.getBean("projectDAO");

project = new Project();
project.setProjectName("Test Project");


<?xml version="1.0" encoding="UTF-8"?>

<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName"><value>com.mysql.jdbc.Driver</value></property>
<property name="url"><value>jdbc:mysql://localhost:3306/project</value></property>
<property name="username"><value>xxx</value></property>
<property name="password"><value>xxx</value></property>

<!-- Hibernate SessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name="dataSource"><ref local="dataSource"/></property>
<property name="mappingResources">
<property name="hibernateProperties">
<prop key="hibernate.dialect">net.sf.hibernate.dialect.MySQLDialect</prop>
<prop key="">update</prop>

<!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) -->
<bean id="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager">
<property name="sessionFactory"><ref local="sessionFactory"/></property>

<bean id="projectDAO" class="com.x.pmo.dao.ProjectDAO">
<property name="sessionFactory"><ref local="sessionFactory"/></property>

Chris Boldon
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Answered my own question:

..hibernate.. should be ..hibernate3.. in the xml file in case others have a similar problem.
He got surgery to replace his foot with a pig. He said it was because of this tiny ad:
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic