java.lang.ArrayIndexOutOfBoundsException:

时间:2014-01-28 05:15:01

标签: java

我的android + Ksoap [axis 2]应用程序的tomcat控制台连续显示此错误

它没有提到我创建的任何类。然后我无法了解它。我的Web服务项目中有很多类。

因此请不要downvote

java.lang.ArrayIndexOutOfBoundsException: 5
        at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java
:630)
        at org.apache.axis2.rpc.receivers.RPCUtil.processRequest(RPCUtil.java:15
3)
        at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.jav
a:206)
        at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic
(RPCMessageReceiver.java:117)
        at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusines
sLogic(AbstractInOutMessageReceiver.java:40)
        at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMe
ssageReceiver.java:114)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
        at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReq
uest(HTTPTransportUtils.java:172)
        at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:1
46)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:103)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:861)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ss(Http11Protocol.java:606)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:48
9)
        at java.lang.Thread.run(Unknown Source)

2 个答案:

答案 0 :(得分:0)

根据文件http://docs.oracle.com/javase/6/docs/api/java/lang/ArrayIndexOutOfBoundsException.html

Thrown to indicate that an array has been accessed with an illegal index. The index is either negative or greater than or equal to the size of the array.

答案 1 :(得分:0)

经过一些研究,我已经解决了这种避免复杂类型(如Lists和使用Arrays)作为方法参数的问题。

我认为这是部署Web服务方法时的最佳做法。

因此,Web服务方法的签名 sync

public String sync(List<Operation> ops, String station, String sync_date)  

需要修改为

public String sync(Operation[] ops, String station, String sync_date)