Announcement Announcement Module
No announcement yet.
Problem Hibernate 3 - Spring 1.2 RC1 Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem Hibernate 3 - Spring 1.2 RC1

    I get the following exception when I'm trying to create a SessionFactory in the applicationContext:

    Exception in thread "main" org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory' defined in class path resource [org/bejug/jobs/properties/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: net/sf/hibernate/HibernateException
    java.lang.NoClassDefFoundError: net/sf/hibernate/HibernateException
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    at java.lang.Class.getDeclaredMethods(Unknown Source)
    at java.beans.Introspector$ Source)
    at Method)
    at java.beans.Introspector.getPublicDeclaredMethods(U nknown Source)
    at java.beans.Introspector.getTargetMethodInfo(Unknow n Source)
    at java.beans.Introspector.getBeanInfo(Unknown Source)
    at java.beans.Introspector.getBeanInfo(Unknown Source)
    at org.springframework.beans.CachedIntrospectionResul ts.<init>(
    at org.springframework.beans.CachedIntrospectionResul ts.forClass(
    at org.springframework.beans.BeanWrapperImpl.setIntro spectionClass(
    at org.springframework.beans.BeanWrapperImpl.setWrapp edInstance(
    at org.springframework.beans.BeanWrapperImpl.setWrapp edInstance(
    at org.springframework.beans.BeanWrapperImpl.<init>(B
    at BeanFactory.createBeanWrapper(AbstractBeanFactory. java:557)
    at AutowireCapableBeanFactory.createBean(AbstractAuto
    at AutowireCapableBeanFactory.createBean(AbstractAuto
    at BeanFactory.getBean(
    at BeanFactory.getBean(
    at istableBeanFactory.preInstantiateSingletons(Defaul
    at ationContext.refresh(AbstractApplicationContext.ja va:317)
    at plicationContext.<init>(ClassPathXmlApplicationCon
    at plicationContext.<init>(ClassPathXmlApplicationCon
    at plicationContext.<init>(ClassPathXmlApplicationCon
    at onContext.<init>( 5)
    at onContext.main(

    My applicationContext is the following:

    <?xml version="1.0" encoding="UTF-8"?>
    Copyright (C) 2005 The Java Community

    This program is free software; you can redistribute it and/or modify it under
    the terms of the GNU General Public License as published by the Free Software
    Foundation; either version 2 of the License, or (at your option) any later

    This program is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along with
    this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    Place, Suite 330, Boston, MA 02111-1307 USA.


    <bean id="propertyConfigurer"
    class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer">
    <property name="locations">

    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverM anagerDataSource">
    <property name="driverClassName">
    <property name="url">
    <property name="username">
    <property name="password">

    <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSess ionFactoryBean">
    <property name="dataSource">
    <ref local="dataSource"/>
    <property name="mappingResources">
    <property name="hibernateProperties">
    <prop key="hibernate.dialect">${hibernate.dialect}</prop>
    <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
    <prop key="">${hibernate.hbm2ddl.a uto}</prop>

    Now, I see that the HibernateException is in another package in Hibernate 3.
    I thought Spring 1.2 RC1 supports Hibernate 3?
    Anyone encoutered the same problem?

  • #2
    You need to change some packages (in app. context and elsewhere). Take a look at this thread.

    For example:
    should become


    • #3
      Thx mate!

      That solved my prob!