Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via GitHub by mod3st
, 1 year ago
String index out of range: 4
via Stack Overflow by gstackoverflow
, 2 years ago
java.lang.StringIndexOutOfBoundsException: String index out of range: 4	at java.lang.AbstractStringBuilder.getChars(AbstractStringBuilder.java:385)	at java.lang.StringBuilder.getChars(StringBuilder.java:76)	at org.apache.lucene.analysis.tokenattributes.CharTermAttributeImpl.append(CharTermAttributeImpl.java:183)	at org.apache.lucene.analysis.stempel.StempelFilter.incrementToken(StempelFilter.java:76)	at org.apache.lucene.analysis.synonym.SynonymFilter.parse(SynonymFilter.java:358)	at org.apache.lucene.analysis.synonym.SynonymFilter.incrementToken(SynonymFilter.java:624)	at org.apache.lucene.analysis.miscellaneous.UniqueTokenFilter.incrementToken(UniqueTokenFilter.java:53)	at org.apache.lucene.index.DefaultIndexingChain$PerField.invert(DefaultIndexingChain.java:712)	at org.apache.lucene.index.DefaultIndexingChain.processField(DefaultIndexingChain.java:417)	at org.apache.lucene.index.DefaultIndexingChain.processDocument(DefaultIndexingChain.java:373)	at org.apache.lucene.index.DocumentsWriterPerThread.updateDocuments(DocumentsWriterPerThread.java:272)	at org.apache.lucene.index.DocumentsWriter.updateDocuments(DocumentsWriter.java:433)	at org.apache.lucene.index.IndexWriter.updateDocuments(IndexWriter.java:1375)	at org.elasticsearch.index.engine.InternalEngine.update(InternalEngine.java:564)	at org.elasticsearch.index.engine.InternalEngine.innerIndex(InternalEngine.java:522)	at org.elasticsearch.index.engine.InternalEngine.index(InternalEngine.java:409)	at org.elasticsearch.index.shard.IndexShard.index(IndexShard.java:556)	at org.elasticsearch.index.shard.IndexShard.index(IndexShard.java:546)	at org.elasticsearch.action.index.TransportIndexAction.executeIndexRequestOnPrimary(TransportIndexAction.java:191)	at org.elasticsearch.action.bulk.TransportShardBulkAction.shardIndexOperation(TransportShardBulkAction.java:348)	at org.elasticsearch.action.bulk.TransportShardBulkAction.shardUpdateOperation(TransportShardBulkAction.java:411)	at org.elasticsearch.action.bulk.TransportShardBulkAction.update(TransportShardBulkAction.java:233)	at org.elasticsearch.action.bulk.TransportShardBulkAction.handleItem(TransportShardBulkAction.java:138)	at org.elasticsearch.action.bulk.TransportShardBulkAction.onPrimaryShard(TransportShardBulkAction.java:120)	at org.elasticsearch.action.bulk.TransportShardBulkAction.onPrimaryShard(TransportShardBulkAction.java:73)	at org.elasticsearch.action.support.replication.TransportWriteAction.shardOperationOnPrimary(TransportWriteAction.java:75)	at org.elasticsearch.action.support.replication.TransportWriteAction.shardOperationOnPrimary(TransportWriteAction.java:48)	at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryShardReference.perform(TransportReplicationAction.java:905)	at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryShardReference.perform(TransportReplicationAction.java:875)	at org.elasticsearch.action.support.replication.ReplicationOperation.execute(ReplicationOperation.java:113)	at org.elasticsearch.action.support.replication.TransportReplicationAction$AsyncPrimaryAction.onResponse(TransportReplicationAction.java:323)	at org.elasticsearch.action.support.replication.TransportReplicationAction$AsyncPrimaryAction.onResponse(TransportReplicationAction.java:258)	at org.elasticsearch.action.support.replication.TransportReplicationAction$1.onResponse(TransportReplicationAction.java:855)	at org.elasticsearch.action.support.replication.TransportReplicationAction$1.onResponse(TransportReplicationAction.java:852)	at org.elasticsearch.index.shard.IndexShardOperationsLock.acquire(IndexShardOperationsLock.java:142)	at org.elasticsearch.index.shard.IndexShard.acquirePrimaryOperationLock(IndexShard.java:1655)	at org.elasticsearch.action.support.replication.TransportReplicationAction.acquirePrimaryShardReference(TransportReplicationAction.java:864)	at org.elasticsearch.action.support.replication.TransportReplicationAction.access$400(TransportReplicationAction.java:90)	at org.elasticsearch.action.support.replication.TransportReplicationAction$AsyncPrimaryAction.doRun(TransportReplicationAction.java:275)	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)	at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryOperationTransportHandler.messageReceived(TransportReplicationAction.java:254)	at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryOperationTransportHandler.messageReceived(TransportReplicationAction.java:246)	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler.lambda$messageReceived$1(SecurityServerTransportInterceptor.java:208)	at org.elasticsearch.common.util.concurrent.EsExecutors$1.execute(EsExecutors.java:109)	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler.lambda$messageReceived$2(SecurityServerTransportInterceptor.java:246)	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:53)	at org.elasticsearch.xpack.security.transport.ServerTransportFilter$NodeProfile.lambda$null$0(ServerTransportFilter.java:135)	at org.elasticsearch.xpack.security.authz.AuthorizationUtils$AsyncAuthorizer.maybeRun(AuthorizationUtils.java:131)	at org.elasticsearch.xpack.security.authz.AuthorizationUtils$AsyncAuthorizer.setRunAsRoles(AuthorizationUtils.java:125)	at org.elasticsearch.xpack.security.authz.AuthorizationUtils$AsyncAuthorizer.authorize(AuthorizationUtils.java:113)	at org.elasticsearch.xpack.security.transport.ServerTransportFilter$NodeProfile.lambda$inbound$1(ServerTransportFilter.java:137)	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:53)	at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.lambda$authenticateAsync$0(AuthenticationService.java:180)	at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.lambda$lookForExistingAuthentication$2(AuthenticationService.java:199)	at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.lookForExistingAuthentication(AuthenticationService.java:211)	at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.authenticateAsync(AuthenticationService.java:178)	at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.access$000(AuthenticationService.java:140)	at org.elasticsearch.xpack.security.authc.AuthenticationService.authenticate(AuthenticationService.java:112)	at org.elasticsearch.xpack.security.transport.ServerTransportFilter$NodeProfile.inbound(ServerTransportFilter.java:131)	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler.messageReceived(SecurityServerTransportInterceptor.java:253)	at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:69)	at org.elasticsearch.transport.TransportService$6.doRun(TransportService.java:577)	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:527)	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)	at java.lang.Thread.run(Thread.java:745)