Announcement Announcement Module
Collapse
No announcement yet.
Hibernate3 support broken? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hibernate3 support broken?

    Hi!

    I'm using spring 1.2.7 and hibernate 3.0.5, extending the org.springframework.orm.hibernate3.support.Hiberna teDaoSupport class.

    I get this stack trace:

    java.lang.NoClassDefFoundError: net/sf/hibernate/Interceptor
    at java.lang.Class.getDeclaredMethods(Class.java:1079 )
    at java.beans.Introspector$1.run(Introspector.java:10 37)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.beans.Introspector.getPublicDeclaredMethods(I ntrospector.java:1035)
    at java.beans.Introspector.getTargetEventInfo(Introsp ector.java:741)
    at java.beans.Introspector.getBeanInfo(Introspector.j ava:328)
    at java.beans.Introspector.getBeanInfo(Introspector.j ava:112)
    at org.springframework.beans.CachedIntrospectionResul ts.<init>(CachedIntrospectionResults.java:150)
    at org.springframework.beans.CachedIntrospectionResul ts.forClass(CachedIntrospectionResults.java:87)
    at org.springframework.beans.BeanWrapperImpl.setIntro spectionClass(BeanWrapperImpl.java:237)
    at org.springframework.beans.BeanWrapperImpl.setWrapp edInstance(BeanWrapperImpl.java:195)
    at org.springframework.beans.BeanWrapperImpl.setWrapp edInstance(BeanWrapperImpl.java:179)
    at org.springframework.beans.BeanWrapperImpl.<init>(B eanWrapperImpl.java:132)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.instantiateBean(Abstrac tAutowireCapableBeanFactory.java:487)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:362)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:233)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:145)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:186)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:106)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:1046)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:857)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:378)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:233)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:145)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:186)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:106)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:1046)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:857)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:378)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveInnerBeanDefinition(Bea nDefinitionValueResolver.java:151)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:97)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:1046)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:857)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:378)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:233)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:145)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:277)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:313)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:87)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:72)
    at java.lang.reflect.Constructor.newInstance(Native Method)
    at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:172)
    at org.springframework.beans.factory.support.SimpleIn stantiationStrategy.instantiate(SimpleInstantiatio nStrategy.java:78)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.autowireConstructor(Abs tractAutowireCapableBeanFactory.java:703)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:358)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:233)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:145)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:283)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:313)
    at org.springframework.context.access.ContextSingleto nBeanFactoryLocator.initializeDefinition(ContextSi ngletonBeanFactoryLocator.java:136)
    at org.springframework.beans.factory.access.Singleton BeanFactoryLocator.useBeanFactory(SingletonBeanFac toryLocator.java:386)

    <SNIP>

    using this application context config:

    <bean id="dataSource"
    class="org.springframework.jdbc.datasource.DriverM anagerDataSource">
    <property name="username" value="postgres" />
    <property name="password" value="postgres" />
    <property name="url"
    value="jdbcostgresql://localhost:5432/accountattributes" />
    <property name="driverClassName" value="org.postgresql.Driver" />
    </bean>

    <bean id="sessionFactory"
    class="org.springframework.orm.hibernate.LocalSess ionFactoryBean">
    <property name="dataSource" ref="dataSource" />
    <property name="mappingResources">
    <list>
    <value>accountattributes.hbm.xml</value>
    </list>
    </property>
    </bean>

    <bean id="AccountAttributes"
    name="AccountAttributesDao"
    class="AccountAttributesDaoHibernateImpl">
    <property name="sessionFactory" ref="sessionFactory" />
    </bean>


    which I really do not understand as this is hibernate3 and not hibernate2???

  • #2
    Wrong baseclass

    I was using the wrong baseclass, it should read:

    class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean"

    Comment

    Working...
    X