I'm using Spring 4.0.4
and use HttpInvoker
from Spring to update Objects of a different application which is usually running on the same Tomcat.
The problem is, that attributes, which are customized Objects, only contain the unique Id
and no other parameters (e.g. name) on the remote site.
I have to say first, that the problem appears only on Linux, not on Windows systems. This means, that the configuration cannot be that wrong.
The configuration is very simple and based on the Spring documentation (http://docs.spring.io/spring/docs/current/spring-framework-reference/html/remoting.html).
<bean id="applicationRemoteService" class="com.commitpro.apps.usermgmt.ws.application.ApplicationRemoteServiceImpl" />
<bean name="applicationExporter" class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
<property name="service" ref="applicationRemoteService"/>
<property name="serviceInterface" value="com.commitpro.apps.humnet.base.ws.application.ApplicationRemoteServiceI"/>
</bean>
On the client side it is configured like this:
<bean id="applicationRemoteService" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
<property name="serviceUrl" ref="applicationServiceUrl" />
<property name="serviceInterface" value="com.commitpro.apps.humnet.base.ws.application.ApplicationRemoteServiceI" />
</bean>
The method of the ApplicationRemoteServiceImpl
looks as follows:
public void saveDepartmentToApplication(ApplicationE application, Department department) throws Exception {...}
The department
instance only has an id
(int) but the String name
is unfortunately null. The same with location
and divisionSet
which are members of department.
The Department object looks as follows:
public class Department extends DivisionBaseA<Department> {
private static final long serialVersionUID = -6170085791318124502L;
private int id;
private Location location;
private Set<Division> divisionSet = new TreeSet<Division>();
DivisionBaseA:
public abstract class DivisionBaseA<E> implements Serializable, Comparable<E> {
private static final long serialVersionUID = 4028530780182033960L;
private String name, description;
private boolean active = true;
Has it something to do with the Serialization? Is there a difference between Windows and Linux systems?
I updated Spring to 4.2.2.RELEASE and now it is working.