Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.yiqiniu.easytrans.util.ObjectDigestUtil.getComlpexObjectOrderedString(ObjectDigestUtil.java:119)
at com.yiqiniu.easytrans.util.ObjectDigestUtil.getObjectString(ObjectDigestUtil.java:97)
at com.yiqiniu.easytrans.util.ObjectDigestUtil.getComlpexObjectOrderedString(ObjectDigestUtil.java:112)
... 2 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.yiqiniu.easytrans.util.ObjectDigestUtil.getComlpexObjectOrderedString(ObjectDigestUtil.java:110)
... 4 more
Caused by: java.lang.IllegalArgumentException
at java.sql.Date.getHours(Date.java:187)
... 9 more
原因是ObjectDigestUtil类中会利用反射去获取类的属性,而java.sql.Date类中getHours()、getMinutes()、getSeconds()都会直接throw new java.lang.IllegalArgumentException(),源代码如下:
@Deprecated
public int getSeconds() {
throw new java.lang.IllegalArgumentException();
}
在消息消息实体类中包含java.sql.Date类型时,会有如下报错
原因是ObjectDigestUtil类中会利用反射去获取类的属性,而java.sql.Date类中getHours()、getMinutes()、getSeconds()都会直接throw new java.lang.IllegalArgumentException(),源代码如下:
所以修改了ObjectDigestUtil类中的getObjectString方法,提交了一个Pull request,请查看