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:
My class declaration (I think the method itself is not that important here):
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.io.WriteAbortedException: writing aborted;java.io.NotSerializableException:
For completion the transaction part of my appContext configuration:
public class TagCount extends UnicastRemoteObject
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.
<property name="sessionFactory" ref="sessionFactory" />
Thanks in advance for any hints and help!