Announcement Announcement Module
No announcement yet.
Instantiation failed for LocalSessionFactoryBean Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Instantiation failed for LocalSessionFactoryBean

    I am getting the following error when starting my application which I hoped would use Spring and Hibernate.

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory' defined in resource [/WEB-INF/daoContext.xml] of ServletContext: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/transaction/TransactionManager java.lang.NoClassDefFoundError:
    javax/transaction/TransactionManager at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.ja va:1627) at java.lang.Class.getDeclaredMethods

    Config stanza in daoContext.xml is:
    <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSess ionFactoryBean">

    <property name="dataSource">
    <ref bean="dataSource"/>

    <property name="hibernateProperties">
    <prop key="hibernate.dialect">org.hibernate.dialect.Orac le9Dialect</prop>

    <property name="mappingResources">


    I'm using Spring 1.2.3 and Hibernate2.jar that came with the Spring distribution. I'm using j2sdk1.4.

    I noticed that Java 1.4 has no class called javax/transaction/TransactionManager. Is the error being caused by a Java-Spring version mis-match?
    If so, what would be the appropriate versions.
    If not, any thoughts on what might be happening would be appreciated.

    Thanks in advance,

  • #2
    You need to include the jta.jar. It's in the Spring download in the lib/j2ee directory.