java.lang.StringIndexOutOfBoundsException: String index out of range: 0

Coderanch | ethaniel landfough | 8 years ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to rafael . Or join the community to write better ones.
  1. 0

    How to know which button being clicked??

    Coderanch | 8 years ago | ethaniel landfough
    java.lang.StringIndexOutOfBoundsException: String index out of range: 0
  2. 0
    samebug tip
    Thrown by String methods to indicate that an index is either negative or greater than the size of the string. For some methods such as the charAt method, this exception also is thrown when the index is equal to the size of the string.
  3. 0

    If you have a line in a hibernate mapping file like this: <property name="" /> the result is this error message: Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:444) at org.hibernate.mapping.Column.setName(Column.java:60) at org.hibernate.cfg.HbmBinder.bindColumns(HbmBinder.java:1033) at org.hibernate.cfg.HbmBinder.bindColumnsOrFormula(HbmBinder.java:1437) at org.hibernate.cfg.HbmBinder.bindSimpleValue(HbmBinder.java:1069) at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:1982) at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:1940) at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:324) at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:238) at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:109) at org.hibernate.cfg.Configuration.add(Configuration.java:385) at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:426) at org.hibernate.cfg.Configuration.addResource(Configuration.java:481) at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1443) at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1411) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1392) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1368) at org.hibernate.cfg.Configuration.configure(Configuration.java:1288) at org.hibernate.cfg.Configuration.configure(Configuration.java:1274) at com.loren.SimpleExample.startHibernate(SimpleExample.java:37) at com.loren.SimpleExample.main(SimpleExample.java:45) The user should get a clearer error message, not a strack trace that looks like an internal hibernate programming error.

    Hibernate JIRA | 1 decade ago | Loren Rosen
    java.lang.StringIndexOutOfBoundsException: String index out of range: 0
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    If you have a line in a hibernate mapping file like this: <property name="" /> the result is this error message: Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:444) at org.hibernate.mapping.Column.setName(Column.java:60) at org.hibernate.cfg.HbmBinder.bindColumns(HbmBinder.java:1033) at org.hibernate.cfg.HbmBinder.bindColumnsOrFormula(HbmBinder.java:1437) at org.hibernate.cfg.HbmBinder.bindSimpleValue(HbmBinder.java:1069) at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:1982) at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:1940) at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:324) at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:238) at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:109) at org.hibernate.cfg.Configuration.add(Configuration.java:385) at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:426) at org.hibernate.cfg.Configuration.addResource(Configuration.java:481) at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1443) at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1411) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1392) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1368) at org.hibernate.cfg.Configuration.configure(Configuration.java:1288) at org.hibernate.cfg.Configuration.configure(Configuration.java:1274) at com.loren.SimpleExample.startHibernate(SimpleExample.java:37) at com.loren.SimpleExample.main(SimpleExample.java:45) The user should get a clearer error message, not a strack trace that looks like an internal hibernate programming error.

    Hibernate JIRA | 1 decade ago | Loren Rosen
    java.lang.StringIndexOutOfBoundsException: String index out of range: 0
  6. 0

    Error in running OAF page from server:

    Oracle Community | 6 years ago | AntonyRaj
    java.lang.StringIndexOutOfBoundsException: String index out of range: 0

  1. linxiaolong 1 times, last 2 months ago
  2. jokester 1 times, last 2 months ago
  3. tyson925 1 times, last 3 months ago
  4. Torasque 1 times, last 4 months ago
  5. Hronom 32257 times, last 4 months ago
11 more registered users
18 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: 0

    at java.lang.String.charAt()
  2. Java RT
    String.charAt
    1. java.lang.String.charAt(String.java:444)
    1 frame
  3. Unknown
    Lat1.actionPerformed
    1. Lat1.actionPerformed(Lat1.java:74)
    1 frame
  4. Java RT
    EventDispatchThread.run
    1. javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
    2. javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
    3. javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    4. javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    5. javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
    6. java.awt.Component.processMouseEvent(Component.java:5100)
    7. java.awt.Component.processEvent(Component.java:4897)
    8. java.awt.Container.processEvent(Container.java:1569)
    9. java.awt.Component.dispatchEventImpl(Component.java:3615)
    10. java.awt.Container.dispatchEventImpl(Container.java:1627)
    11. java.awt.Component.dispatchEvent(Component.java:3477)
    12. java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
    13. java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
    14. java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
    15. java.awt.Container.dispatchEventImpl(Container.java:1613)
    16. java.awt.Window.dispatchEventImpl(Window.java:1606)
    17. java.awt.Component.dispatchEvent(Component.java:3477)
    18. java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
    19. java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
    20. java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    21. java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
    22. java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
    23. java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    23 frames