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

问题描述

atjava.lang.String.checkBounds(String.java:402)atjava.lang.String.<init>(String.java:443)atjxl.biff.StringHelper.getString(StringHelper.java:164)atjxl.read.biff.WriteAccessRecord.<init>(WriteAccessRecord.java:56)atjxl.read.biff.WorkbookParser.parse(WorkbookParser.java:821)atjxl.Workbook.getWorkbook(Workbook.java:237)atjxl.Workbook.getWorkbook(Workbook.java:198)atcom.iedudata.action.AddStudentResultRecordAction.addExamResult(AddStudentResultRecordAction.java:454)atcom.iedudata.action.AddStudentResultRecordAction.addStudentResultRecord(AddStudentResultRecordAction.java:89)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:597)atcom.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)atcom.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)atcom.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)atcom.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)atcom.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)atcom.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)atorg.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)atcom.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)atcom.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)atcom.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)atcom.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)atcom.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)atcom.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)atcom.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)atcom.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)atcom.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)atorg.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)atcom.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)atorg.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)atcom.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)atcom.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)atcom.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)atcom.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)atcom.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)atorg.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)atcom.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)atorg.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)atcom.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)atcom.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)atcom.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)atcom.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)atcom.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)atcom.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121)atcom.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)atcom.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)atorg.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)atcom.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)atcom.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)atcom.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)atcom.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)

解决方案

解决方案二:
你贴异常。。没有用。。。把代码贴出来。。。
解决方案三:
这一行代码com.iedudata.action.AddStudentResultRecordAction.addExamResult执行的时候,访问某个String出现越界,可能String没有116那么长,但是却使用了subString()等方法,就会出现StringIndexOutOfBoundsException异常,明显的字符串索引越界了。
解决方案四:
引用2楼salever的回复:

这一行代码com.iedudata.action.AddStudentResultRecordAction.addExamResult执行的时候,访问某个String出现越界,可能String没有116那么长,但是却使用了subString()等方法,就会出现StringIndexOutOfBoundsException异常,明显的字符串索引越界了。

晕你都说了让楼下的怎么办
解决方案五:
数组越界了,把需要的地方长度打印出来吧,看看是不是循环什么的超出长度了。

时间: 2024-11-05 20:36:56

java.lang.StringIndexOutOfBoundsException: String index out of range: 116的相关文章

string-java 程序运行出现String index out of range: -1异常请各位大神指教

问题描述 java 程序运行出现String index out of range: -1异常请各位大神指教 import java.awt.*; import javax.swing.*; import java.sql.*; import java.awt.event.*; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.State

java.sql.SQLException: Parameter index out of range (1 &amp;amp;gt; number of parameters, w

问题描述 public class Register {public static boolean register(String name, String password) throws SQLException, ClassNotFoundException {Class.forName("com.mysql.jdbc.Driver");Connection cn = DriverManager.getConnection("jdbc:mysql://localhost

Caused by: java.lang.NoSuchFieldError: STRING 这是什么异常呢?

问题描述 2010-12-12 23:02:34 org.apache.catalina.loader.WebappClassLoader validateJarFile信息: validateJarFile(D:Tomcat6Tomcat 6.0webappsoa_01WEB-INFlibservlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/S

java.lang 类String

方法摘要1  char    charAt(int index)            返回指定索引处的 char 值.               index - char 值的索引.2 string       concat(String str)           将指定字符串连接到此字符串的结尾.                 str - 连接到此 String 结尾的 String.          substring(int beginIndex)           返回一个

java java.lang.StringIndexOutOfBoundsException报错

问题描述 packagecom.app.demo1;importjava.util.ArrayList;importjava.util.Arrays;//importbsh.EvalError;//importbsh.Interpreter;importandroid.app.Activity;importandroid.os.Bundle;importandroid.view.View;importandroid.view.View.OnClickListener;importandroid.

java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0

就是数组越界了,意思是你某个地方调用了数组的下标为3但是这个数组的实际大小是0.所以有这种错误.你检查一下你的代码看哪里调用某个数组.

mysql-Parameter index out of range 好心人求解决在线等 急

问题描述 Parameter index out of range 好心人求解决在线等 急 代码如下 求解哪里错误 package com.pact.mobilestore; import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; import jav

mysql- Parameter index out of range

问题描述 Parameter index out of range 代码如下 求解哪里错误 package com.pact.mobilestore; import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.Array

Java的“java.lang.ArrayIndexOutOfBoundsException: length=1; index=1”

Java中, 错误: "java.lang.ArrayIndexOutOfBoundsException: length=1; index=1" ; 意思: 数组(Array)索引(Index)越界(OutOfBounds)异常(Exception),长度(length)为1, 索引(index)为1; 因为索引值(index)要小于长度值(length), 索引是从0开始; 根据位置信息, 判断错误位置: at mzx.spike.earthquake.app.EarthquakeL