Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

java.lang.ArrayIndexOutOfBoundsException

Status
Not open for further replies.

Ngai88

Programmer
Sep 8, 2004
56
US
hello,
Can someone tell me what this error message mean? I know is something to do with not being able to get the data from the database but usually what causes that to error out?

"java.lang.ArrayIndexOutOfBoundsException: 0"

Thanks,
Ngai
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Apache Tomcat/4.0.5 - HTTP Status 500 - Internal Server Error

type Exception report
message Internal Server Error
description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
exception
java.lang.ArrayIndexOutOfBoundsException: 0
at oracle.jdbc.dbaccess.DBDataSetImpl._getDBItem(DBDataSetImpl.java:318)
at oracle.jdbc.dbaccess.DBDataSetImpl._createOrGetDBItem(DBDataSetImpl.java:561)
at oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:1746)
at oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java:855)
at oracle.jdbc.driver.OraclePreparedStatement.setInt(OraclePreparedStatement.java:1139)
at com.shipanalytics.cms.dbobj.forms.FormsDBO.getFile(FormsDBO.java:197)
at com.shipanalytics.cms.dbobj.forms.FormsDBO.getTemplateFile(FormsDBO.java:171)
at com.shipanalytics.cms.servlet.ImageServlet.doGet(ImageServlet.java:100)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
at java.lang.Thread.run(Thread.java:534)

 
I means you have tried to access an array subscript that does not exist (ie memory that has not been allocated for you).
EG :

String[] arr = new String[3];
arr[4] = "abc";

This will throw an ArrayIndexOutOfBoundsException

--------------------------------------------------
Free Database Connection Pooling Software
 
The java.lang.ArrayIndexOutOfBoundsException means an array in your program has been accessed with an illegal index. The index is either negative or greater than or equal to the size of the array.

Example:

int[] count = new int[10];
System.out.println("This will abort " + count[10]);
System.out.println("This will abort too" + count[-1]);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top