Spring結合Hessian協議遠程調用方法名不能重載

遇到下面的異常:

server端:

 <2015-7-28 下午08時51分38秒 CST> <Error> <HTTP> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContext@17df584 - appName: '_appsdir_manager_dir', name: 'manager', context-path: '', spec-version: 'null', request: weblogic.servlet.internal.ServletRequestImpl@1ef2975[
POST /*****/remote/filenoHttpInvoker HTTP/1.1
Cookie: JSESSIONID=TB2GV30pv1zDDdrvjPjCh8221vv8v0Xp79Y8LGGvPWKLcKn4ynTT!148068397; path=/
User-Agent: Java/1.6.0_13
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-type: application/x-www-form-urlencoded
Content-Length: 41

]] 
Root cause of ServletException.
com.caucho.hessian.io.HessianProtocolException: getOldBudgetByFile: expected string at 0x7a (z)
at com.caucho.hessian.io.HessianInput.error(HessianInput.java:1559)
at com.caucho.hessian.io.HessianInput.expect(HessianInput.java:1547)
at com.caucho.hessian.io.HessianInput.readString(HessianInput.java:755)
at com.caucho.hessian.io.BasicDeserializer.readObject(BasicDeserializer.java:199)
at com.caucho.hessian.io.HessianInput.readObject(HessianInput.java:1014)
Truncated. see log file for complete stacktrace 

client端:
com.caucho.hessian.client.HessianConnectionException: 500: java.io.IOException: Server returned HTTP response code: 500 for URL: http://127.0.0.1:7001/******/remote/filenoHttpInvoker
at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:207)
at $Proxy48.getOldBudgetByFile(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.remoting.caucho.HessianClientInterceptor.invoke(HessianClientInterceptor.java:219)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy49.getOldBudgetByFile(Unknown Source)

最終定位原因爲BO業務類中有兩個getOldBudgetByFile()方法,如下:
1、public List getOldBudgetByFile(String file_name) throws Exception

2、 public List getOldBudgetByFile(String file_name, String set_year) throws Exception 

遇到這種問題,只能要求方法換一個名字,避免使用方法重載。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章