日期:2014-05-18  浏览次数:20803 次

大家进来帮分析一下java.lang.IndexOutOfBoundsException: Index: 0, Size: 0什么错误?
我在调用一个方法传入参数的时候   出现错误如下:

java.lang.IndexOutOfBoundsException:   Index:   0,   Size:   0
at   java.util.ArrayList.RangeCheck(ArrayList.java:507)
at   java.util.ArrayList.get(ArrayList.java:324)
at   com.crystaldecisions.sdk.occa.infostore.internal.al.get(Unknown   Source)
at   com.businessobjects.BO.getDocumentInstance(BO.java:207)
at   com.neusoft.tax.hxzg.hblt.bo.bl.applogic.BOUtil.getWebiPrompts(BOUtil.java:740)
at   com.neusoft.tax.hxzg.hblt.bo.web.action.BOQueryAction.getWebiViewParameters(BOQueryAction.java:658)
at   com.neusoft.tax.hxzg.hblt.bo.web.action.BOQueryAction.WebiView(BOQueryAction.java:785)
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:324)
at   org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:276)
at   org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:196)
at   org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at   org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at   com.neusoft.unieap.action.EAPActionServlet.process(EAPActionServlet.java:483)
at   org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at   weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
at   weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
at   weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
at   weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at   com.neusoft.tax.platform.framework.web.FilterServlet.doFilter(FilterServlet.java:97)
at   weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at   weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7053)
at   weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at   weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at   weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
at   weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
at   weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at   weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
大家帮分析一下   是什么原因造成的?

------解决方案--------------------
java.util.ArrayList.RangeCheck 说你 ArrayList 越界了 检查一下你所有ArrayList 取值的时候越界没!
------解决方案--------------------
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
说明你索引越界了 ArrayList 得存值问题
------解决方案--------------------
意思是你用的arraylist实例中,size是0,就是长度为0

但你却引用了超过这个0的范围,其实类似数组超界
------解决方案--------------------
楼上正解~!
------解决方案--------------------
at java.util.ArrayList.get(ArrayList.java:324)
at com.crystaldeci