Announcement Announcement Module
No announcement yet.
Spring Transaction Management for Websphere Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Transaction Management for Websphere

    Hey guys!! Happy New Year!

    I am facing a strange behavior with spring tx management, maybe any of you has faced the same problem.

    Here's the scenario:

    I have 4 boxes with a Websphere 5.1 Instance hosting some web applications, and I am using Spring to manage the transactions the following way:

    <bean id="webSphereJtaTm" class="org.springframework.transaction.jta.WebSphereTransactionManagerFactoryBean"/>
    <bean id="jtaTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
    		<property name="transactionManager" ref="webSphereJtaTm"/>
    <bean id="OrderDAO" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
    	<property name="target">
    		<ref local="orderProcessor" />
    	<property name="transactionManager" ref="jtaTransactionManager"/>
    	<property name="transactionAttributes">
    			<prop key="saveOrder">
    			<prop key="deleteOrder">
    			<prop key="loadOrder">
    			<prop key="getPersistence">
    			<prop key="setPersistence">
    The problem is that sometimes it seems that for one of my servers the transaction manager for UserTransaction is not created properly since I am getting a NullPointerException:

    [1/5/09 17:13:39:223 EST] 72f2ba5 BaseAction E TRAS0014I: The following exception was logged java.lang.NullPointerExce
    at tChange(
    at (
    at org.springframework.transaction.jta.JtaTransaction Manager.doJtaBegin(
    at org.springframework.transaction.jta.JtaTransaction Manager.doBegin(
    at atformTransactionManager.getTransaction(AbstractPl
    at org.springframework.transaction.interceptor.Transa ctionAspectSupport.createTransactionIfNecessary(Tr
    at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:101)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed( (Compiled Code))
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(
    at $Proxy15.loadOrder(Unknown Source)

    The thing I've seen is that for the other 3 servers I am using JTA UserTransaction: and for the one that is getting the exception I am getting JTA UserTransaction:

    Another thing, I've also found a quick workaround, if I reload the application context the beans start working fine.

    Has anyone faced the same problem?

    Is there any way to tell spring to use the class instead of the ejs one?

    Or does anyone know why am I facing like an initialization problem, I think this might be a websphere configuration thing but I am not quite sure.

    Any help is really appreciated!!

    Thank you!!

    - Vic