java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

Stack Overflow | user3665151 | 3 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    [DBCP-290] java.sql.SQLException: Closed Statement - ASF JIRA

    apache.org | 1 year ago
    JdbcTemplate.java: 479) at org.springframework.jdbc.core.JdbcTemplate.queryForInt(JdbcTemplate.java:488 )
  2. 0

    Shuffle not working in Java

    Stack Overflow | 1 year ago | Vickz
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    We are getting below exception in production randomly..Using Spring(2.5) JDBC for all our DB related functionality.We don't handle any DB resources directly.everything thru Spring JDBC template. This app was running fine in Weblogic but after migrating to Tomcat6+DBCP(1.2.2) we are seeing the below exception. We also looked our code base for any threading or concurrency issues..we were not able spot any issues. I have observed one more thing..why checkOpen in DelegatingPreparedStatement didn't catch this but OracleStatement thinks the statement is closed. Is it bcos the DBCP is returing the closed connection? (DBCP-273) Caused by: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [INSERT INTO AUDIT_TRAIL ( DEAL_ID , AUDIT_TRAIL_ID ) VALUES ( ?,? ) ]; SQL state [null]; error code [17009]; Closed Statement; nested exception is java.sql.SQLException: Closed Statement at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:124) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:322) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:607) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:792) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:815) at org.springframework.jdbc.object.SqlUpdate.update(SqlUpdate.java:168) at com.dao.DealXAuditTrailDaoBase.insertDealXAuditTrailVoBase(Unknown Source) at com.deal.DealTO.insertAuditTrail(DealTO.java:183) at com.deal.DealTO.processAuditTrail(DealTO.java:168) at com.deal.DealTO.update(DealTO.java:110) at com.deal.DealTO$$FastClassByCGLIB$$fba55fe6.invoke(<generated>) at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at com.businessrules.SpexBusinessRuleValidator.invoke(SpexBusinessRuleValidator.java:64) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635) at com.deal.DealTO$$EnhancerByCGLIB$$54d9c9a4.update(<generated>) at com.entity.EntityGeneralInfoController.copyFieldsToDeal(EntityGeneralInfoController.java:1158) at com.entity.EntityGeneralInfoController.doSave(EntityGeneralInfoController.java:429) ... 30 more Caused by: java.sql.SQLException: Closed Statement at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227) at oracle.jdbc.driver.OracleStatement.ensureOpen(OracleStatement.java:3249) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2867) at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:2957) at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:798) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:591) <Resource name="oracleDS" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@xxxxx:1521:xxxxx" username="xxxx" password="xxxx" initialSize="2" maxActive="30" maxIdle="30" maxWait="3000" minIdle="0" testOnBorrow="true" testOnReturn="false" testWhileIdle="false" poolPreparedStatements="true" maxOpenPreparedStatements="10" removedAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true" validationQuery="select count(*) from dual"/>

    Apache's JIRA Issue Tracker | 8 years ago | kan
    com.ibm.websphere.ce.cm.ObjectClosedException: DSRA9110E: Connection is closed. at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQ LStateSQLExceptionTranslator.java:124) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translat e(SQLErrorCodeSQLExceptionTranslator.java:322) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:407) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:458) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:466) at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java: 474) at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java: 479) at org.springframework.jdbc.core.JdbcTemplate.queryForInt(JdbcTemplate.java:488 )

  1. brunosatriani 5 times, last 9 months ago
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.IndexOutOfBoundsException

    Index: 0, Size: 0

    at java.util.ArrayList.RangeCheck()
  2. Java RT
    Collections.swap
    1. java.util.ArrayList.RangeCheck(Unknown Source)
    2. java.util.ArrayList.get(Unknown Source)
    3. java.util.Collections.swap(Unknown Source)
    3 frames
  3. com.hbc.vp
    SearchSMFController.setUpForm
    1. com.hbc.vp.services.SMFService.getUpdatedBannersList(SMFService.java:609)
    2. com.hbc.vp.services.SMFService.getBannerList(SMFService.java:582)
    3. com.hbc.vp.controllers.SearchSMFController.setUpForm(SearchSMFController.java:113)
    3 frames