org.springframework.data.repository.query.ParameterOutOfBoundsException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

Spring JIRA | Michael Bauer | 4 years ago
  1. 0

    IndexOutOfBoundsException in Spring Data MongoDB Repository

    Stack Overflow | 4 years ago | CodeChimp
    org.springframework.data.repository.query.ParameterOutOfBoundsException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
  2. 0

    If you create a finder method in a Repository object but neglect to provide the proper parameters, you get an {{IndexOutOfBoundsException}}. I would expect a better, more informative exception. Here is the stack trace: {noformat} org.springframework.data.repository.query.ParameterOutOfBoundsException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at org.springframework.data.repository.query.Parameters.getParameter(Parameters.java:168) at org.springframework.data.repository.query.Parameters.getBindableParameter(Parameters.java:238) at org.springframework.data.repository.query.ParametersParameterAccessor.getBindableValue(ParametersParameterAccessor.java:98) at org.springframework.data.repository.query.ParametersParameterAccessor$BindableParameterIterator.next(ParametersParameterAccessor.java:126) at org.springframework.data.mongodb.repository.query.ConvertingParameterAccessor$ConvertingIterator.next(ConvertingParameterAccessor.java:187) at org.springframework.data.mongodb.repository.query.ConvertingParameterAccessor$ConvertingIterator.nextConverted(ConvertingParameterAccessor.java:195) at org.springframework.data.mongodb.repository.query.MongoQueryCreator.from(MongoQueryCreator.java:216) at org.springframework.data.mongodb.repository.query.MongoQueryCreator.create(MongoQueryCreator.java:102) at org.springframework.data.mongodb.repository.query.MongoQueryCreator.create(MongoQueryCreator.java:48) at org.springframework.data.repository.query.parser.AbstractQueryCreator.createCriteria(AbstractQueryCreator.java:109) at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:88) at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:73) at org.springframework.data.mongodb.repository.query.PartTreeMongoQuery.createQuery(PartTreeMongoQuery.java:69) at org.springframework.data.mongodb.repository.query.AbstractMongoQuery.execute(AbstractMongoQuery.java:82) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:301) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy75.findByLoginId(Unknown Source) at com.thirtytwopasteight.xchange.services.UserServiceImpl.findSiteUsersByLoginIdEquals(UserServiceImpl.java:39) at com.sample.test.authentication.LocalUserDetailsService.loadUserByUsername(LocalUserDetailsService.java:32) at org.springframework.security.authentication.dao.DaoAuthenticationProvider.retrieveUser(DaoAuthenticationProvider.java:81) at org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:132) at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:156) at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:174) at org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter.attemptAuthentication(UsernamePasswordAuthenticationFilter.java:94) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:194) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at com.springsource.insight.collection.tcserver.request.HttpRequestOperationCollectionValve.traceNextValve(HttpRequestOperationCollectionValve.java:116) at com.springsource.insight.collection.tcserver.request.HttpRequestOperationCollectionValve.invoke(HttpRequestOperationCollectionValve.java:98) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:604) at java.util.ArrayList.get(ArrayList.java:382) at org.springframework.data.repository.query.Parameters.getParameter(Parameters.java:166) ... 59 more org.springframework.data.repository.query.ParameterOutOfBoundsException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at org.springframework.data.repository.query.Parameters.getParameter(Parameters.java:168) at org.springframework.data.repository.query.Parameters.getBindableParameter(Parameters.java:238) at org.springframework.data.repository.query.ParametersParameterAccessor.getBindableValue(ParametersParameterAccessor.java:98) at org.springframework.data.repository.query.ParametersParameterAccessor$BindableParameterIterator.next(ParametersParameterAccessor.java:126) at org.springframework.data.mongodb.repository.query.ConvertingParameterAccessor$ConvertingIterator.next(ConvertingParameterAccessor.java:187) at org.springframework.data.mongodb.repository.query.ConvertingParameterAccessor$ConvertingIterator.nextConverted(ConvertingParameterAccessor.java:195) at org.springframework.data.mongodb.repository.query.MongoQueryCreator.from(MongoQueryCreator.java:216) at org.springframework.data.mongodb.repository.query.MongoQueryCreator.create(MongoQueryCreator.java:102) at org.springframework.data.mongodb.repository.query.MongoQueryCreator.create(MongoQueryCreator.java:48) at org.springframework.data.repository.query.parser.AbstractQueryCreator.createCriteria(AbstractQueryCreator.java:109) at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:88) at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:73) at org.springframework.data.mongodb.repository.query.PartTreeMongoQuery.createQuery(PartTreeMongoQuery.java:69) at org.springframework.data.mongodb.repository.query.AbstractMongoQuery.execute(AbstractMongoQuery.java:82) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:301) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy75.findByLoginId(Unknown Source) at com.sample.test.services.UserServiceImpl.findSiteUsersByLoginIdEquals(UserServiceImpl.java:39) at com.sample.test.authentication.LocalUserDetailsService.loadUserByUsername(LocalUserDetailsService.java:32) at org.springframework.security.authentication.dao.DaoAuthenticationProvider.retrieveUser(DaoAuthenticationProvider.java:81) at org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:132) at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:156) at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:174) at org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter.attemptAuthentication(UsernamePasswordAuthenticationFilter.java:94) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:194) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at com.springsource.insight.collection.tcserver.request.HttpRequestOperationCollectionValve.traceNextValve(HttpRequestOperationCollectionValve.java:116) at com.springsource.insight.collection.tcserver.request.HttpRequestOperationCollectionValve.invoke(HttpRequestOperationCollectionValve.java:98) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:604) at java.util.ArrayList.get(ArrayList.java:382) at org.springframework.data.repository.query.Parameters.getParameter(Parameters.java:166) ... 59 more {noformat}

    Spring JIRA | 4 years ago | Michael Bauer
    org.springframework.data.repository.query.ParameterOutOfBoundsException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
  3. 0

    If you create a finder method in a Repository object but neglect to provide the proper parameters, you get an {{IndexOutOfBoundsException}}. I would expect a better, more informative exception. Here is the stack trace: {noformat} org.springframework.data.repository.query.ParameterOutOfBoundsException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at org.springframework.data.repository.query.Parameters.getParameter(Parameters.java:168) at org.springframework.data.repository.query.Parameters.getBindableParameter(Parameters.java:238) at org.springframework.data.repository.query.ParametersParameterAccessor.getBindableValue(ParametersParameterAccessor.java:98) at org.springframework.data.repository.query.ParametersParameterAccessor$BindableParameterIterator.next(ParametersParameterAccessor.java:126) at org.springframework.data.mongodb.repository.query.ConvertingParameterAccessor$ConvertingIterator.next(ConvertingParameterAccessor.java:187) at org.springframework.data.mongodb.repository.query.ConvertingParameterAccessor$ConvertingIterator.nextConverted(ConvertingParameterAccessor.java:195) at org.springframework.data.mongodb.repository.query.MongoQueryCreator.from(MongoQueryCreator.java:216) at org.springframework.data.mongodb.repository.query.MongoQueryCreator.create(MongoQueryCreator.java:102) at org.springframework.data.mongodb.repository.query.MongoQueryCreator.create(MongoQueryCreator.java:48) at org.springframework.data.repository.query.parser.AbstractQueryCreator.createCriteria(AbstractQueryCreator.java:109) at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:88) at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:73) at org.springframework.data.mongodb.repository.query.PartTreeMongoQuery.createQuery(PartTreeMongoQuery.java:69) at org.springframework.data.mongodb.repository.query.AbstractMongoQuery.execute(AbstractMongoQuery.java:82) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:301) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy75.findByLoginId(Unknown Source) at com.thirtytwopasteight.xchange.services.UserServiceImpl.findSiteUsersByLoginIdEquals(UserServiceImpl.java:39) at com.sample.test.authentication.LocalUserDetailsService.loadUserByUsername(LocalUserDetailsService.java:32) at org.springframework.security.authentication.dao.DaoAuthenticationProvider.retrieveUser(DaoAuthenticationProvider.java:81) at org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:132) at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:156) at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:174) at org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter.attemptAuthentication(UsernamePasswordAuthenticationFilter.java:94) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:194) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at com.springsource.insight.collection.tcserver.request.HttpRequestOperationCollectionValve.traceNextValve(HttpRequestOperationCollectionValve.java:116) at com.springsource.insight.collection.tcserver.request.HttpRequestOperationCollectionValve.invoke(HttpRequestOperationCollectionValve.java:98) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:604) at java.util.ArrayList.get(ArrayList.java:382) at org.springframework.data.repository.query.Parameters.getParameter(Parameters.java:166) ... 59 more org.springframework.data.repository.query.ParameterOutOfBoundsException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at org.springframework.data.repository.query.Parameters.getParameter(Parameters.java:168) at org.springframework.data.repository.query.Parameters.getBindableParameter(Parameters.java:238) at org.springframework.data.repository.query.ParametersParameterAccessor.getBindableValue(ParametersParameterAccessor.java:98) at org.springframework.data.repository.query.ParametersParameterAccessor$BindableParameterIterator.next(ParametersParameterAccessor.java:126) at org.springframework.data.mongodb.repository.query.ConvertingParameterAccessor$ConvertingIterator.next(ConvertingParameterAccessor.java:187) at org.springframework.data.mongodb.repository.query.ConvertingParameterAccessor$ConvertingIterator.nextConverted(ConvertingParameterAccessor.java:195) at org.springframework.data.mongodb.repository.query.MongoQueryCreator.from(MongoQueryCreator.java:216) at org.springframework.data.mongodb.repository.query.MongoQueryCreator.create(MongoQueryCreator.java:102) at org.springframework.data.mongodb.repository.query.MongoQueryCreator.create(MongoQueryCreator.java:48) at org.springframework.data.repository.query.parser.AbstractQueryCreator.createCriteria(AbstractQueryCreator.java:109) at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:88) at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:73) at org.springframework.data.mongodb.repository.query.PartTreeMongoQuery.createQuery(PartTreeMongoQuery.java:69) at org.springframework.data.mongodb.repository.query.AbstractMongoQuery.execute(AbstractMongoQuery.java:82) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:301) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy75.findByLoginId(Unknown Source) at com.sample.test.services.UserServiceImpl.findSiteUsersByLoginIdEquals(UserServiceImpl.java:39) at com.sample.test.authentication.LocalUserDetailsService.loadUserByUsername(LocalUserDetailsService.java:32) at org.springframework.security.authentication.dao.DaoAuthenticationProvider.retrieveUser(DaoAuthenticationProvider.java:81) at org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:132) at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:156) at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:174) at org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter.attemptAuthentication(UsernamePasswordAuthenticationFilter.java:94) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:194) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at com.springsource.insight.collection.tcserver.request.HttpRequestOperationCollectionValve.traceNextValve(HttpRequestOperationCollectionValve.java:116) at com.springsource.insight.collection.tcserver.request.HttpRequestOperationCollectionValve.invoke(HttpRequestOperationCollectionValve.java:98) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:604) at java.util.ArrayList.get(ArrayList.java:382) at org.springframework.data.repository.query.Parameters.getParameter(Parameters.java:166) ... 59 more {noformat}

    Spring JIRA | 4 years ago | Michael Bauer
    org.springframework.data.repository.query.ParameterOutOfBoundsException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Invalid parameter index! You seem to have declare too little query method parameters! - Spring Mongo TextSearch

    Stack Overflow | 9 months ago | javatechnology
    org.springframework.data.repository.query.ParameterOutOfBoundsException: Invalid parameter index! You seem to have declare too little query method parameters!
  6. 0

    @Cucumber.Options(format={"pretty", "html:target/cucumber"}) fails

    GitHub | 3 years ago | dean-schulze
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
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
    ArrayList.get
    1. java.util.ArrayList.rangeCheck(ArrayList.java:604)
    2. java.util.ArrayList.get(ArrayList.java:382)
    2 frames
  3. Spring Data Core
    ParametersParameterAccessor$BindableParameterIterator.next
    1. org.springframework.data.repository.query.Parameters.getParameter(Parameters.java:166)
    2. org.springframework.data.repository.query.Parameters.getBindableParameter(Parameters.java:238)
    3. org.springframework.data.repository.query.ParametersParameterAccessor.getBindableValue(ParametersParameterAccessor.java:98)
    4. org.springframework.data.repository.query.ParametersParameterAccessor$BindableParameterIterator.next(ParametersParameterAccessor.java:126)
    4 frames
  4. Spring Data MongoDB - Core
    MongoQueryCreator.create
    1. org.springframework.data.mongodb.repository.query.ConvertingParameterAccessor$ConvertingIterator.next(ConvertingParameterAccessor.java:187)
    2. org.springframework.data.mongodb.repository.query.ConvertingParameterAccessor$ConvertingIterator.nextConverted(ConvertingParameterAccessor.java:195)
    3. org.springframework.data.mongodb.repository.query.MongoQueryCreator.from(MongoQueryCreator.java:216)
    4. org.springframework.data.mongodb.repository.query.MongoQueryCreator.create(MongoQueryCreator.java:102)
    5. org.springframework.data.mongodb.repository.query.MongoQueryCreator.create(MongoQueryCreator.java:48)
    5 frames
  5. Spring Data Core
    AbstractQueryCreator.createQuery
    1. org.springframework.data.repository.query.parser.AbstractQueryCreator.createCriteria(AbstractQueryCreator.java:109)
    2. org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:88)
    3. org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:73)
    3 frames
  6. Spring Data MongoDB - Core
    AbstractMongoQuery.execute
    1. org.springframework.data.mongodb.repository.query.PartTreeMongoQuery.createQuery(PartTreeMongoQuery.java:69)
    2. org.springframework.data.mongodb.repository.query.AbstractMongoQuery.execute(AbstractMongoQuery.java:82)
    2 frames
  7. Spring Data Core
    RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke
    1. org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:301)
    1 frame
  8. Spring AOP
    JdkDynamicAopProxy.invoke
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    2 frames
  9. Unknown
    $Proxy75.findByLoginId
    1. $Proxy75.findByLoginId(Unknown Source)
    1 frame
  10. com.thirtytwopasteight.xchange
    UserServiceImpl.findSiteUsersByLoginIdEquals
    1. com.thirtytwopasteight.xchange.services.UserServiceImpl.findSiteUsersByLoginIdEquals(UserServiceImpl.java:39)
    1 frame
  11. com.sample.test
    LocalUserDetailsService.loadUserByUsername
    1. com.sample.test.authentication.LocalUserDetailsService.loadUserByUsername(LocalUserDetailsService.java:32)
    1 frame
  12. spring-security-core
    ProviderManager.authenticate
    1. org.springframework.security.authentication.dao.DaoAuthenticationProvider.retrieveUser(DaoAuthenticationProvider.java:81)
    2. org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:132)
    3. org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:156)
    4. org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:174)
    4 frames
  13. Spring Security
    FilterChainProxy.doFilter
    1. org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter.attemptAuthentication(UsernamePasswordAuthenticationFilter.java:94)
    2. org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:194)
    3. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    4. org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
    5. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    6. org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
    7. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    8. org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
    8 frames
  14. Spring
    DelegatingFilterProxy.doFilter
    1. org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
    2. org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
    2 frames
  15. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    2 frames
  16. Spring
    OncePerRequestFilter.doFilter
    1. org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
    2. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    2 frames
  17. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    2 frames
  18. Spring
    OncePerRequestFilter.doFilter
    1. org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    2. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    2 frames
  19. Glassfish Core
    StandardEngineValve.invoke
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
    4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    7. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    8. org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    9. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    9 frames
  20. com.springsource.insight
    HttpRequestOperationCollectionValve.invoke
    1. com.springsource.insight.collection.tcserver.request.HttpRequestOperationCollectionValve.traceNextValve(HttpRequestOperationCollectionValve.java:116)
    2. com.springsource.insight.collection.tcserver.request.HttpRequestOperationCollectionValve.invoke(HttpRequestOperationCollectionValve.java:98)
    2 frames
  21. Glassfish Core
    CoyoteAdapter.service
    1. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    1 frame
  22. Grizzly HTTP
    NioEndpoint$SocketProcessor.run
    1. org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
    2. org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
    3. org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
    3 frames
  23. Java RT
    Thread.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    3. java.lang.Thread.run(Thread.java:722)
    3 frames