protostuff
protostuff copied to clipboard
I trying to serialize this class below but failed.v1.0
public class ServiceRequest implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private String serviceid;
private ServiceMethodEntity methodEntity;
private Map<String, String> parameter = null;
public ServiceMethodEntity getMethodEntity() {
return methodEntity;
}
public void setMethodEntity(ServiceMethodEntity methodEntity) {
this.methodEntity = methodEntity;
}
public void addParameter(String name, String value){
if(null == this.parameter)
parameter = new HashMap<String, String>();
this.parameter.put(name, value);
}
public String getParameter(String name){
if(null == this.parameter)
return null;
return this.parameter.get(name);
}
public String getServiceid() {
return serviceid;
}
public void setServiceid(String serviceid) {
this.serviceid = serviceid;
}
}
public class ServiceMethodEntity implements Serializable{
public static int LESS = 1;
public static int MORE = 2;
/**
*
*/
private static final long serialVersionUID = 1L;
private Class<?> obejctClass;
private String methodName;
private Object[] args;
private Class<?>[] argsTypes;
private int type = ServiceMethodEntity.LESS;
public ServiceMethodEntity() {
}
public ServiceMethodEntity(Class<?> obejctClass, String methodName, Object[] args) {
this.methodName = methodName;
this.obejctClass = obejctClass;
this.args = args;
}
public String getMethodName() {
return methodName;
}
public void setMethodName(String methodName) {
this.methodName = methodName;
}
public Object[] getArgs() {
return args;
}
public void setArgs(Object[] args) {
this.args = args;
}
public Class<?> getObejctClass() {
return obejctClass;
}
public void setObejctClass(Class<?> obejctClass) {
this.obejctClass = obejctClass;
}
public Class<?>[] getArgsTypes() {
return argsTypes;
}
public void setArgsTypes(Class<?>[] argsTypes) {
this.argsTypes = argsTypes;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
}
What's the stacktrace? Please post a sample test case that uses this class and triggers the exception?