Results 1 to 4 of 4

Thread: Accessing hibernate 3 with spring 1.2 TypeMisMatchException

  1. #1
    Join Date
    Apr 2005
    Posts
    8

    Default Accessing hibernate 3 with spring 1.2 TypeMisMatchException

    When using spring 1.2 RC1 with Hibernate 3 I am getting the following exception. Any pointers on solving this is appreciated. Thanks. My application.xml has the following entry:
    <bean id="sessionFactory"
    class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
    <property name="dataSource">
    <ref local="dataSource"/>
    </property>
    <property name="mappingResources">
    <list>
    <value>mappings/Service_RequestSubClass.hbm.xml
    </value>
    </list>
    </property>
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">org.hibernate.dialect.SQLS erverDialect</prop>
    <prop key="hibernate.cache.provider_class">org.hibernate .cache.HashtableCacheProvider</prop>
    </props>
    </property>
    </bean>


    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'objectAccessManager' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyAccessExceptions Exception: PropertyAccessExceptionsException (1 errors); nested propertyAccessExceptions are: [org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.hibernate.impl.SessionFactoryImpl] to required type [net.sf.hibernate.SessionFactory] for property 'sessionFactory']
    PropertyAccessExceptionsException (1 errors)
    org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.hibernate.impl.SessionFactoryImpl] to required type [net.sf.hibernate.SessionFactory] for property 'sessionFactory'
    at org.springframework.beans.BeanWrapperImpl.doTypeCo nversionIfNecessary(BeanWrapperImpl.java:998)
    at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.java:761)
    at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.java:668)
    at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.java:808)
    at org.springframework.beans.BeanWrapperImpl.setPrope rtyValues(BeanWrapperImpl.java:835)
    at org.springframework.beans.BeanWrapperImpl.setPrope rtyValues(BeanWrapperImpl.java:824)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:857)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:675)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:331)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:257)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:222)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:146)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:291)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:317)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:80)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:65)
    at org.springframework.context.access.ContextJndiBean FactoryLocator.createBeanFactory(ContextJndiBeanFa ctoryLocator.java:40)
    at org.springframework.beans.factory.access.JndiBeanF actoryLocator.useBeanFactory(JndiBeanFactoryLocato r.java:68)
    at org.springframework.ejb.support.AbstractEnterprise Bean.loadBeanFactory(AbstractEnterpriseBean.java:1 19)
    at org.springframework.ejb.support.AbstractStatelessS essionBean.ejbCreate(AbstractStatelessSessionBean. java:63)

  2. #2
    Join Date
    Apr 2005
    Posts
    8

    Default Ok NM, Was importing the wrong HibernateDAOSupport class

    Was importing classes from old spring hibernate DAO support

  3. #3
    Join Date
    Sep 2005
    Posts
    1

    Default

    hi,

    i'm having the same exception. can you tell ma more details, how did you fix it?

    thank you

  4. #4
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    I guess he switched from org.springframework.orm.hibernate.support.Hibernat eDaoSupport to org.springframework.orm.hibernate3.support.Hiberna teDaoSupport.



    Regards,
    Andreas

Similar Threads

  1. Replies: 5
    Last Post: Feb 3rd, 2009, 05:19 AM
  2. Replies: 3
    Last Post: Aug 16th, 2007, 12:10 PM
  3. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM
  4. Replies: 2
    Last Post: Nov 12th, 2004, 05:23 AM
  5. Replies: 7
    Last Post: Aug 21st, 2004, 03:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •