Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4536740
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:34:37+00:00 2026-05-21T14:34:37+00:00

I have a problem that has been using Hibernate 3.6.0 for a very long

  • 0

I have a problem that has been using Hibernate 3.6.0 for a very long time (or versions around here). This project has been in development since 2009 and has slowly but surely upgraded Hibernate versions. It’s been using 3.6.x for some time.

I tried upgrading to 3.6.3 to see if it fixed the problem – it didn’t. My tests still run.

I just recently created an implementation for DefaultPreUpdateEventListener. It works great when I unit test it in IntelliJ. It works when I run the tests in Maven. However, when I run my application in Tomcat, I get this stupid classpath error:

Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [trainingdividend.dao.UpdatedOnEventListener] for bean with name 'trainingdividend.dao.UpdatedOnEventListener#1342f5b' defined in file [C:\Users\egervari\IdeaProjects\trainingdividend-experiment\target\classes\applicationContext.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/hibernate/event/def/DefaultPreUpdateEventListener
    at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1253)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:433)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270)
    ... 118 more
Caused by: java.lang.NoClassDefFoundError: org/hibernate/event/def/DefaultPreUpdateEventListener
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1026)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1483)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
    at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)
    at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1271)
    at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1242)
    ... 120 more
Caused by: java.lang.ClassNotFoundException: org.hibernate.event.def.DefaultPreUpdateEventListener
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
    ... 136 more

This doesn’t really make sense. I have had no problems at all running Hibernate up to this point. None. Why is it that all of a sudden I am getting jar hell problems now for? I mean, this works in the unit/integration tests!

I really hate these kinds of problems. I’d appreciate it if someone could help. I’ve spent 2 hours trying to find out what is up, but I see no problem. My maven dependencies look good – it is only loading 1 version of Hibernate.

At times like this, I wish I was using Rails. I doubt they ever put up with this crap.

Here’s my spring configuration of Hibernate:

<bean id="sessionFactory"
      class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="eventListeners">
        <map>
            <entry key="pre-update">
                <bean class="trainingdividend.dao.UpdatedOnEventListener" />
            </entry>
        </map>
    </property>
    <property name="dataSource" ref="dataSource"/>
    <property name="mappingResources">
        <list>
            <value>hibernate/coursetemplate.hbm.xml</value>
            <value>hibernate/address.hbm.xml</value>
            <value>hibernate/user.hbm.xml</value>
            <value>hibernate/trainee.hbm.xml</value>
            <value>hibernate/company.hbm.xml</value>
            <value>hibernate/instructor.hbm.xml</value>
            <value>hibernate/module.hbm.xml</value>
            <value>hibernate/sysadmin.hbm.xml</value>
        </list>
    </property>
    <property name="namingStrategy">
        <bean class="org.hibernate.cfg.ImprovedNamingStrategy"/>
    </property>
    <property name="hibernateProperties">
        <props>
            <prop key="javax.persistence.validation.mode">none</prop>

            <prop key="hibernate.dialect">${hibernate.dialect}</prop>
            <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}
            </prop>
            <prop key="hibernate.generate_statistics">false</prop>

            <prop key="hibernate.show_sql">false</prop>
            <prop key="hibernate.format_sql">true</prop>

            <prop key="hibernate.cache.use_second_level_cache">false</prop>
            <prop key="hibernate.cache.provider_class">
                org.hibernate.cache.EhCacheProvider
            </prop>
        </props>
    </property>
</bean>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T14:34:38+00:00Added an answer on May 21, 2026 at 2:34 pm

    check the jars are included in the class path. try putting jars in tomcat lib.

    if u r using custom listeners have u tried adding the event listeners explicitly in the configuration?

    <event type="load">
                <listener class="com.eg.MyLoadListener"/>
                <listener class="org.hibernate.event.def.DefaultLoadEventListener"/>
    </event>
    

    or u can implement org.hibernate.event.PreUpdateEventListener

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my problem. I have a program that has to run in a
I'm having a strange problem here... I have an ASP.NET 3.5 application that has
I have a layout that is working, but it has one very annoying problem..
This is a problem that has been eating at me for a while, and
I have to test some things on a project which has been developed by
I have a connection protocol that has been defined by our customer. Data are
I have been using Shawn Wildermuths example and it has been working fine no
I have a Swing Application running under Linux, that has problems to display accented
I have a problem that confuses my users, being that although an item is
I have the problem that an specific step in Ant can only be executed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.