facebook

Hibernate/Spring SessionFactory TypeMismatchException(start)

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #256314 Reply

    Hi all,
    I’m trying to integrate hibernate and spring into a test project. This is my first foray into Spring and Hibernate.
    When I start Tomcat (5.5) I get the following error:

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myTransactionManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyAccessExceptionsException: PropertyAccessExceptionsException (1 errors); nested propertyAccessExceptions are: [org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy0] to required type [net.sf.hibernate.SessionFactory] for property 'sessionFactory']

    Here’s the transaction manager entry in my applicationContext.xml:

    <bean id="myTransactionManager"
        class="org.springframework.orm.hibernate.HibernateTransactionManager">
        <property name="sessionFactory">
            <ref local="sessionFactory" />
        </property>
    </bean>
    

    I think I may have a problem mixing Hibernate 2 and 3 jars since I think the package name of net.sf.hibernate.SessionFactory may be from Hibernate v2 to v3 but I’m not sure.

    I’d appreciate any help.
    Thanks!

    #256384 Reply

    Brian Fernandes
    Moderator

    Hi,

    Well, what version of Spring and Hibernate did you add to your project and how did you set it up?
    If you used our library sets, you can go to Project > Properties > Java Build Path > Add Library and then choose MyEclipse libraries. You can then add libaries to your project.
    Simply right click an existing library > Build Path to remove it from your build path.

    If you actually copied the JARs into your project, it might be better off starting from scratch. Add Hibernate 3.1 followed by Spring.
    Best,
    Brian.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Hibernate/Spring SessionFactory TypeMismatchException(start)

You must be logged in to post in the forum log in