Announcement Announcement Module
Collapse
No announcement yet.
@Transactional and RMI Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • @Transactional and RMI

    Hi everyone,

    I am trying to use Spring's transaction support using the above annotation on an existing project (we are trying to migrate to Spring). The method I am trying to make transactional lives in an object that is going to be exported through RMI and I am getting this Exception:

    Code:
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is: 
    java.io.WriteAbortedException: writing aborted;java.io.NotSerializableException:
    org.springframework.beans.factory.support.DefaultListableBeanFactory
    My class declaration (I think the method itself is not that important here):

    Code:
    public class TagCount extends UnicastRemoteObject
    For completion the transaction part of my appContext configuration:

    Code:
    <tx:annotation-driven />
    
    <bean id="transactionManager"
    	class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    	<property name="sessionFactory" ref="sessionFactory" />
    </bean>
    My question is, if it is possible to use @Transactional for RMI exported objects in general or if I am using it in a wrong way somehow? As we are working on existing code the object is exported to RMI manually - would using RmiServiceExporter make a difference? I would think so as one wouldn't need to extend any Remote classes, right? Though switching to Spring managed RMI would involve a lot of code changes for us.

    Thanks in advance for any hints and help!
    Cheers
Working...
X