Announcement Announcement Module
Collapse
No announcement yet.
WebSphereUowTransactionManager - No bean named 'transactionManager' is defined" Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • WebSphereUowTransactionManager - No bean named 'transactionManager' is defined"

    Hi Forum Members,
    I think I am missing something, I really appreciate your help in advance, I have limited time to resolve this, please help.

    I am using JPA entities managed by Hibernate and Spring Framework.



    applicationContext.xml is
    =======
    <jee:jndi-lookup id="DataSource "
    jndi-name="jdbc/sampleDS"
    cache="true"
    resource-ref="true"
    lookup-on-startup="false"
    proxy-interface="javax.sql.DataSource" />

    <bean id="contextApplicationContextProvider" class="com.aacargo.com.services.util.ApplicationCo ntextProvider"/>
    <!-- Hibernate -->
    <bean id="mySessionFactory" class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
    <property name="dataSource" ref="DataSource" />
    <property name="configLocation">
    <value>classpath:hibernate.cfg.xml</value>
    </property>
    <property name="configurationClass">
    <value>org.hibernate.cfg.AnnotationConfiguration </value>
    </property>

    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.show_sql">true</prop>
    <prop key="hibernate.dialect">org.hibernate.dialect.HSQL Dialect</prop>
    </props>
    </property>
    </bean>
    <bean id="user" class="com.service.services.beans.sampleBean" scope="session"/>

    <!-- Transaction management -->
    <tx:annotation-driven/>
    <bean id="wsJtaTm" class="org.springframework.transaction.jta.WebSphe reUowTransactionManager">
    <property name="autodetectTransactionManager" value="true" />
    </bean>
    =======

    Exception Trace:
    Caused by: org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named 'transactionManager' is defined
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.getBeanDefinition(DefaultListab leBeanFactory.java:527)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getMergedLocalBeanDefinition(AbstractB eanFactory.java:1087)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:278 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:198)
    at org.springframework.transaction.interceptor.Transa ctionAspectSupport.determineTransactionManager(Tra nsactionAspectSupport.java:248)
    at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:100)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:202)
    at $Proxy197.populateUserProfile(Unknown Source)
    at com.sample.presentation.ljo.Sample.sampleMethod(Sa mple.java:28)
    ... 52 more

  • #2
    Hello

    1) Use code tags, is more readable for us
    2) About

    Code:
    Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException:
    No bean named 'transactionManager' is defined
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.
    getBeanDefinition(DefaultListab leBeanFactory.java:527)
    When you work with transactions Spring expect you define a bean called transactionManager, proceed to read the Spring Documentation about Transactions to see some examples about that

    Comment


    • #3
      As dr_pompeii already pointed out, use [ code][/code ] tags that way it remains readable...

      You use tx:annotation-driven and don't explicitly assign the transaction-manager to it, then it expects to find a bean named transactionManager in your context. In your context there is no bean name transactionManager you named it 'wsJtaTm'. So either change your 'wsJtaTm' to 'transactionManager' or wire it explicitly to the tx:annotation-driven.

      Comment

      Working...
      X