java.lang.StringIndexOutOfBoundsException: String index out of range: -4

Coderanch | Sen George | 1 decade ago
  1. 0

    Index out of Bound

    Coderanch | 1 decade ago | Sen George
    java.lang.StringIndexOutOfBoundsException: String index out of range: -4
  2. 0

    If someone typoes a, for example, MSN related JID, and puts account/40msn.com@msn.myserver.org The following exception is thrown: java.lang.StringIndexOutOfBoundsException: String index out of range: -4 at java.lang.String.substring(String.java:1768) at org.xmpp.packet.JID.getParts(JID.java:299) at org.xmpp.packet.Packet.<init>(Packet.java:72) at org.xmpp.packet.IQ.<init>(IQ.java:82) at org.jivesoftware.openfire.net.StanzaHandler.getIQ(StanzaHandler.java:272) at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:236) at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:153) at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandler.java:132) at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived(AbstractIoFilterChain.java:703) at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:362) at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:54) at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:800) at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimpleProtocolDecoderOutput.java:62) at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:200) at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:362) at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:54) at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:800) at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:266) at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:326) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) at java.lang.Thread.run(Thread.java:595) Should handle this in a cleaner manner.

    Jive Software Open Source | 9 years ago | Daniel Henninger
    java.lang.StringIndexOutOfBoundsException: String index out of range: -4
  3. 0

    If someone typoes a, for example, MSN related JID, and puts account/40msn.com@msn.myserver.org The following exception is thrown: java.lang.StringIndexOutOfBoundsException: String index out of range: -4 at java.lang.String.substring(String.java:1768) at org.xmpp.packet.JID.getParts(JID.java:299) at org.xmpp.packet.Packet.<init>(Packet.java:72) at org.xmpp.packet.IQ.<init>(IQ.java:82) at org.jivesoftware.openfire.net.StanzaHandler.getIQ(StanzaHandler.java:272) at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:236) at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:153) at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandler.java:132) at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived(AbstractIoFilterChain.java:703) at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:362) at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:54) at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:800) at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimpleProtocolDecoderOutput.java:62) at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:200) at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:362) at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:54) at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:800) at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:266) at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:326) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) at java.lang.Thread.run(Thread.java:595) Should handle this in a cleaner manner.

    JIRA | 9 years ago | Daniel Henninger
    java.lang.StringIndexOutOfBoundsException: String index out of range: -4
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    If someone typoes a, for example, MSN related JID, and puts account/40msn.com@msn.myserver.org The following exception is thrown: java.lang.StringIndexOutOfBoundsException: String index out of range: -4 at java.lang.String.substring(String.java:1768) at org.xmpp.packet.JID.getParts(JID.java:299) at org.xmpp.packet.Packet.<init>(Packet.java:72) at org.xmpp.packet.IQ.<init>(IQ.java:82) at org.jivesoftware.openfire.net.StanzaHandler.getIQ(StanzaHandler.java:272) at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:236) at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:153) at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandler.java:132) at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived(AbstractIoFilterChain.java:703) at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:362) at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:54) at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:800) at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimpleProtocolDecoderOutput.java:62) at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:200) at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:362) at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:54) at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:800) at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:266) at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:326) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) at java.lang.Thread.run(Thread.java:595) Should handle this in a cleaner manner.

    Jive Software Open Source | 9 years ago | Daniel Henninger
    java.lang.StringIndexOutOfBoundsException: String index out of range: -4
  6. 0

    Java String index out of range: -4

    Stack Overflow | 3 years ago | Gratin
    java.lang.StringIndexOutOfBoundsException: String index out of range: -4

  1. richard77 2 times, last 4 days ago
  2. kjhdofjosvs 2 times, last 1 week ago
  3. archenroot 17 times, last 2 weeks ago
  4. Alexandru Popa 2 times, last 4 weeks ago
  5. poroszd 3 times, last 1 month ago
18 more registered users
58 unregistered visitors
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.StringIndexOutOfBoundsException

    String index out of range: -4

    at java.lang.String.substring()
  2. Java RT
    String.substring
    1. java.lang.String.substring(String.java:1768)
    1 frame
  3. Unknown
    strtest.main
    1. strtest.main(strtest.java:24)
    1 frame