有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java Spring HttpInvokerServiceExporter:反序列化的属性对象在Linux上不完整

我使用Spring中的Spring 4.0.4HttpInvoker来更新通常在同一Tomcat上运行的不同应用程序的对象

问题是,作为自定义对象的属性在远程站点上只包含unique Id,而不包含其他参数(例如名称)。 我必须首先说,这个问题只出现在Linux上,而不是Windows系统上。这意味着,配置不可能有那么大的错误

配置非常简单,并且基于Spring文档(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>

在客户端,它的配置如下:

<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>

ApplicationRemoteServiceImpl的方法如下所示:

public void saveDepartmentToApplication(ApplicationE application, Department department) throws Exception {...}

department实例只有一个id(int),但字符串name不幸为空。部门成员{}和{}也是如此

Department对象如下所示:

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>();

A司:

public abstract class DivisionBaseA<E> implements Serializable, Comparable<E> {

private static final long serialVersionUID = 4028530780182033960L;
private String name, description;
private boolean active = true;

这和序列化有关吗?Windows和Linux系统之间有区别吗


共 (1) 个答案

  1. # 1 楼答案

    我将Spring更新为4.2.2。释放,现在它正在工作