• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error on page  RSS feed

Jherald Lacambra
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cant figure out the error may be you could help me?

java.lang.StringIndexOutOfBoundsException: String index out of range: 5
at java.lang.String.substring(String.java:1522)
at FileSize.CheckFileSize.round(CheckFileSize.java:69)
at FileSize.CheckFileSize.dispSize(CheckFileSize.java:59)
at _addproduct._jspService(_addproduct.java:90)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:302)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:407)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:330)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:59)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:523)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:151)
at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
Jeanne Boyarsky
author & internet detective
Posts: 36453
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to the message, you are calling substring on a string that is too short. Try outputing the string (and commenting out the substring call) to see what is getting passed. Better yet, add an if statement to check the length before calling substring.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!