String index out of range: -1怎么处理啊 [问题点数:40分]

Bbs1
本版专家分:0
结帖率 0%
Bbs7
本版专家分:21721
版主
Blank
优秀版主 2016年10月优秀小版主
Blank
红花 2016年10月 Java大版内专家分月排行榜第一
2016年9月 Java大版内专家分月排行榜第一
2016年8月 Java大版内专家分月排行榜第一
2014年4月 Java大版内专家分月排行榜第一
Blank
黄花 2016年11月 Java大版内专家分月排行榜第二
Bbs9
本版专家分:68004
版主
Blank
红花 2016年3月 Java大版内专家分月排行榜第一
2016年2月 Java大版内专家分月排行榜第一
2015年11月 Java大版内专家分月排行榜第一
2015年10月 Java大版内专家分月排行榜第一
2014年8月 Java大版内专家分月排行榜第一
2014年7月 Java大版内专家分月排行榜第一
2014年5月 Java大版内专家分月排行榜第一
Blank
黄花 2016年1月 Java大版内专家分月排行榜第二
2015年12月 Java大版内专家分月排行榜第二
2015年8月 Java大版内专家分月排行榜第二
2015年3月 Java大版内专家分月排行榜第二
2015年1月 Java大版内专家分月排行榜第二
2014年12月 Java大版内专家分月排行榜第二
2014年11月 Java大版内专家分月排行榜第二
2014年6月 Java大版内专家分月排行榜第二
2014年4月 Java大版内专家分月排行榜第二
2014年1月 Java大版内专家分月排行榜第二
2013年11月 Java大版内专家分月排行榜第二
Blank
蓝花 2015年9月 Java大版内专家分月排行榜第三
2015年6月 Java大版内专家分月排行榜第三
2015年5月 Java大版内专家分月排行榜第三
2015年2月 Java大版内专家分月排行榜第三
2014年3月 Java大版内专家分月排行榜第三
2013年12月 Java大版内专家分月排行榜第三
Bbs7
本版专家分:26802
Bbs2
本版专家分:245
Bbs2
本版专家分:245
Bbs1
本版专家分:0
String index out of range: -1 异常,急需处理
nnnn  
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
HTTP Status 500 <em>-</em> rnrn<em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em>rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperException: Exception in JSP: /<em>index</em>.jsp:75rnrn72: bordercolor="#3F96E3">rn73: rn74: rn75: rn77: rn78: rnrnrnStacktrace:rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3<em>1</em>4)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn com.erp.fiter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:34)rnrnrnroot cause rnrnorg.apache.jasper.JasperException: Exception in JSP: /product/newproductinfo.jsp:74rnrn7<em>1</em>: color="Navy">rn72: rn76: rnrnrnStacktrace:rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3<em>1</em>4)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)rn org.apache.jsp.<em>index</em>_jsp._jspService(org.apache.jsp.<em>index</em>_jsp:<em>1</em>33)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3<em>1</em>4)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn com.erp.fiter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:34)rnrnrnroot cause rnrnjava.lang.<em>String</em>IndexOutOfBoundsException: <em>String</em> <em>index</em> out of <em>range</em>: <em>-</em><em>1</em>rn java.lang.<em>String</em>.substring(<em>String</em>.java:<em>1</em>768)rn org.apache.jsp.product.newproductinfo_jsp._jspService(org.apache.jsp.product.newproductinfo_jsp:<em>1</em>47)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3<em>1</em>4)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)rn org.apache.jsp.<em>index</em>_jsp._jspService(org.apache.jsp.<em>index</em>_jsp:<em>1</em>33)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3<em>1</em>4)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn com.erp.fiter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:34)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/5.5.<em>1</em>5 logs.rnrnrn<em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em>rnrnApache Tomcat/5.5.<em>1</em>5
控制台报错数组越界 String index out of range: -1
<em>-</em>
为什么会出现 String index out of range: -13 异常的?
int start = xmlMsg.<em>index</em>Of(tagName_<em>1</em>); start += tagName_<em>1</em>.length(); //计算向后偏移长度 int end = xmlMsg.inde
java.lang.StringIndexOutOfBoundsException:String index out of range:-1
程序如下:rnrn包上述错误,没见过怎么回事?
奇怪的 String index out of range
int chars = newsform.getContent().length(); //总字符数 intrn int PerPage = <em>1</em>000; //每页要分的字符数rn int allpage; //总页数rnrn allpage = (chars + PerPage <em>-</em> <em>1</em>) / (PerPage); //取得总页数rn rn <em>String</em> str[] = new <em>String</em>[allpage];rnrn <em>String</em> news = getStr(newsform.getContent());rn System.out.println(allpage+"页");rn System.out.println(chars+"个字符");rn for (int i = 0; i < allpage; i++) rn rn if (i==allpage<em>-</em><em>1</em>) rn rn str[i] = news.substring((i * PerPage));rn System.out.println(str[i].length());rn rn else rn rn str[i] = news.substring((i * PerPage), ((i + <em>1</em>) * PerPage));rn System.out.println("第"+i+"次"+str[i].length());rn rnrn rn rn打印出:rn6页rn5<em>1</em>9<em>1</em>个字符rn第0次<em>1</em>000rn第<em>1</em>次<em>1</em>000rn第2次<em>1</em>000rn第3次<em>1</em>000rnrn这是错误:<em>String</em> <em>index</em> out of <em>range</em>: 5000rnrn帮我看下怎么会错的?
String index out of range: 48
<em>String</em> <em>index</em> out of <em>range</em>: 48
Bits index out of range
对 Delphi 5 ClientDataSet, Edit操作, Post时报错 Bits <em>index</em> out of <em>range</em>, insert时正常, 不知是何原因?
index Out of Range "">"DBGrid index Out of Range "
Query<em>1</em><em>-</em>>DisableControl();rnfor(int i=0; iAppend();rn Query<em>1</em><em>-</em>>FiledByName("f<em>1</em>")<em>-</em>>Value="sss";rn Query<em>1</em><em>-</em>>FiledByName("f2")<em>-</em>>Value="sss<em>1</em>";rn Query<em>1</em><em>-</em>>Post();rnrnQuery<em>1</em><em>-</em>>EnableControl();rnrn为什么加上 :rnQuery<em>1</em><em>-</em>>DisableControl();rnQuery<em>1</em><em>-</em>>EnableControl();rn时有时候会出现"DBGrid <em>index</em> Out of Range " 错误!rn
Android Studio Error:String index out of range:-1
博主遇到此问题的原因是 NDK 版本过高(&amp;gt;=<em>1</em>8),或者说 Android Studio 版本过低(&amp;lt; 3.x),导致不匹配造成的。解决方法是降低 NDK 版本到 <em>1</em>7.x 及以下,或者升级 Android Studio 版本到 3.x。 如果移动端访问不佳,请使用 ==&amp;gt; Github Pages 版。 0x00 异常 最近接手同事的一个项目,在我电脑上使用 Android ...
String index out of range: 100 报错详解
一个很奇葩的报错,出错情况: 在这里进行debug之后可以看到,异常在substring中: 也就是判断字符串的时候报错:具体原因就是string字符串<em>index</em>of的值本身只有5,然后在这里去取其第<em>1</em>00 个字符作为截止,因此就会报这个错;   知识点:主要是堆<em>String</em>概念不清。下面针对字符串相关概念做一个简介。 针对上述问题解决办法: ...
socket连接,关于String index out of range:-1?求大神帮忙!
<em>-</em>
java.lang.StringIndexOutOfBoundsException: String index out of range: 1
笔者源码如下: package javaPractice; import java.util.*; public class TestScanner { public static void main(<em>String</em>[] args) { Scanner sc = new Scanner(System.in); <em>String</em> str = sc.nextL...
java 程序运行出现String index out of range: -1异常请各位大神指教
<em>-</em>
java.lang.StringIndexOutOfBoundsException: String index out of range: 9 at java
java.lang.<em>String</em>IndexOutOfBoundsException: <em>String</em> <em>index</em> out of <em>range</em>: 9 rnat java.lang.<em>String</em>.substring(<em>String</em>.java:<em>1</em>765) rnat com.sq.entity.builder.Utilities.getStrLen(Utilities.java:<em>1</em>462) rnat org.apache.jsp.entity.member.resenterpriselist_jsp._jspService(resenterpriselist_jsp.java:373) rnat org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) rnat javax.servlet.http.HttpServlet.service(HttpServlet.java:7<em>1</em>7) rnat org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) rnat org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) rnat org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) rnat javax.servlet.http.HttpServlet.service(HttpServlet.java:7<em>1</em>7) rnat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) rnat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) rnat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) rnat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:<em>1</em>9<em>1</em>) rnat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:<em>1</em>28) rnat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:<em>1</em>02) rnat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:<em>1</em>09) rnat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) rnat org.apache.coyote.http<em>1</em><em>1</em>.Http<em>1</em><em>1</em>Processor.process(Http<em>1</em><em>1</em>Processor.java:845) rnat org.apache.coyote.http<em>1</em><em>1</em>.Http<em>1</em><em>1</em>Protocol$Http<em>1</em><em>1</em>ConnectionHandler.process(Http<em>1</em><em>1</em>Protocol.java:583) rnat org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) rnat java.lang.Thread.run(Thread.java:595) rnrnrn这是一个发布的别人的网站,可是里面有很多地方都报的这同一个错,怀疑不是单纯的下标越界问题,不晓得原因究竟出在哪里?希望有遇到类似情况 的高手解答一下迷津,谢了!!!
错误提示:String index out of range: 500?
请教大家: rn我在数据录入时把好几个字段用"*"分开,存储在一个字段中。在从数据库中取出数据时,语句如下. rnResultSet rs=st.executeQuery("select * from tblMain"); rnrs.next(); rn<em>String</em> resip=rs.get<em>String</em>("resipID"); rnzym=rs.get<em>String</em>("title"); rnfujiazym=rs.get<em>String</em>("titleAlternative"); rnint m=fujiazym.length(); rnint i=0; rnint j=0; rnint k=0; rn<em>String</em> fjzym[]; rnfjzym=new <em>String</em>[20]; rnrnwhile(!(fujiazym.equals("*"))) rnj=fujiazym.<em>index</em>Of('*'); rnk++; rnfjzym[k]=fujiazym.substring(i,j); rnfujiazym=fujiazym.substring(j+<em>1</em>,m); rn rn执行后出现错误提示, rnjava.lang.<em>String</em>IndexOutOfBoundsException: <em>String</em> <em>index</em> out of <em>range</em>: 500 rn我的数据库中的titleAlternative字段大小是500.请教是何原因rnrn
grid index out of range
beginrn dmData.adoQCode.open;rn dmData.adoQCode.Append;rn dmData.adoQCode.FieldByName('Type').As<em>String</em> := cbbType.Text;rn dmData.adoQCode.FieldByName('Value').As<em>String</em> := edtValue.Text;rn dmData.adoQCode.FieldByName('Mem').As<em>String</em> := edtMem.Text;rn dmdata.adoQCode.Post;rn end;rn我用的是DBgrid和Access库,在添加一条记录时报出grid <em>index</em> out of <em>range</em> 的错误,请各位知道的加以指点
index out of range exception??
<em>index</em> out of <em>range</em> exception??rnrn[color=#FF0000]error code:rnrn if (!Convert.IsDBNull(reader["Name"]))rn username = reader["Name"].To<em>String</em>();[/color]rnrnrn2. source code:rnrn public bool LoginUser(string username,string pwd)rn rn rn bool exists = false;rn SqlParameter[] parms = new SqlParameter[2];rn parms[0] = new SqlParameter("@name", SqlDbType.NVarChar, <em>1</em>00);rn parms[<em>1</em>] = new SqlParameter("@password", SqlDbType.NVarChar, <em>1</em>00);rn parms[0].Value = username;rn parms[<em>1</em>].Value = pwd;rn SqlDataReader reader = DbTools.ExecuteReader("LoginUserProce", parms);rnrn if (reader.Read())rn rn[color=#339966] exists = true;rn if (!Convert.IsDBNull(reader.GetValue(2)))[/color]???????????????rn username = reader.GetValue(2).To<em>String</em>();rn if (!Convert.IsDBNull(reader["password"]))rn pwd = reader["password"].To<em>String</em>();rn rn rn reader.Close();rn return exists;rnrn rnrnrn
请问这个错误怎么改:String index out of range: 10
代码如下: text/html;charset=gb23
String index out of range 报错详解(转载)
今天偶然遇到这样的一个情况,找了一下知道这个解决方法: https://blog.csdn.net/sinat_3622005<em>1</em>/article/details/8<em>1</em>874773
trim()与String index out of range: 0
当使用trim()<em>处理</em>字符串后,发现 <em>String</em> <em>index</em> out of <em>range</em>: 0报错? 而且觉得代码无懈可击?一时想不出来什么时候会为空? 注意特殊情况<em>处理</em>的字符元素都是空格,eg:&quot;        &quot;。空格被清除掉,可不就是空字符串吗,所以需要判断先你现在的<em>String</em>是不是空,再取下标~ 附小陌的错误经历:   class Solution { public ...
java.lang.StringIndexOutOfBoundsException: String index out of range: -1错误
//向服务器获取根目录 public static <em>String</em> getRootList() throws Exception{ <em>String</em> json = "{\"type\":\"getRoot
root cause java.lang.StringIndexOutOfBoundsException: String index out of range
HTTP Status 500 <em>-</em>rnrntype Exception reportrnrnmessagernrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexceptionrnrnorg.apache.jasper.JasperException: java.lang.<em>String</em>IndexOutOfBoundsException: <em>String</em> <em>index</em> out of <em>range</em>: <em>-</em><em>1</em>rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:502)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:430)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3<em>1</em>3)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:7<em>1</em>7)rnroot causernrnjava.lang.<em>String</em>IndexOutOfBoundsException: <em>String</em> <em>index</em> out of <em>range</em>: <em>-</em><em>1</em>rn java.lang.<em>String</em>.substring(<em>String</em>.java:<em>1</em>932)rn org.apache.jsp.admin.product_005fadd_005fok_jsp._jspService(product_005fadd_005fok_jsp.java:78)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:7<em>1</em>7)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3<em>1</em>3)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:7<em>1</em>7)rnnote The full stack trace of the root cause is available in the Apache Tomcat/6.0.33 logs.
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
09:57:40,05<em>1</em> ERROR Dispatcher:38 <em>-</em> Exception occurred during processing request: <em>String</em> <em>index</em> out of <em>range</em>: 0rnjava.lang.<em>String</em>IndexOutOfBoundsException: <em>String</em> <em>index</em> out of <em>range</em>: 0rn at java.lang.<em>String</em>.charAt(<em>String</em>.java:658)rn at org.hibernate.type.CharacterType.get(CharacterType.java:52)rn at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:<em>1</em>86)rn at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:<em>1</em>75)rn at org.hibernate.type.AbstractType.hydrate(AbstractType.java:<em>1</em>05)rn at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2267)rn at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:<em>1</em>443)rn at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:<em>1</em>37<em>1</em>)rn at org.hibernate.loader.Loader.getRow(Loader.java:<em>1</em>27<em>1</em>)rn at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:6<em>1</em>9)rn at org.hibernate.loader.Loader.doQuery(Loader.java:745)rn at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)rn at org.hibernate.loader.Loader.loadEntity(Loader.java:<em>1</em>953)rn at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:86)rn at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:76)rn at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3270)rn at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:496)rn at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:477)rn at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227)rn at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285)rn at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:<em>1</em>52)rn at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:<em>1</em>080)rn at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:<em>1</em>028)rn at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:623)rn at org.hibernate.type.EntityType.resolve(EntityType.java:43<em>1</em>)rn at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:<em>1</em>40)rn at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:898)rn at org.hibernate.loader.Loader.doQuery(Loader.java:773)rn at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)rn at org.hibernate.loader.Loader.doList(Loader.java:2449)rn at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2<em>1</em>92)rn at org.hibernate.loader.Loader.list(Loader.java:2<em>1</em>87)rn at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452)rn at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)rn at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:<em>1</em>96)rn at org.hibernate.impl.SessionImpl.list(SessionImpl.java:<em>1</em>258)rn at org.hibernate.impl.QueryImpl.list(QueryImpl.java:<em>1</em>02)rn at com.bjpowernode.drp.base.daoImp.ClientDaoImp.getfindById(ClientDaoImp.java:89)rn at com.bjpowernode.drp.base.serviceImp.ClientServiceImp.getfindById(ClientServiceImp.java:22)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:606)rn at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:<em>1</em>83)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:<em>1</em>50)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:<em>1</em><em>1</em>0)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:<em>1</em>72)rn at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:<em>1</em>72)rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)rn at com.sun.proxy.$Proxy<em>1</em>8.getfindById(Unknown Source)rn at com.bjpowernode.drp.base.action.ClientAction.getfindById(ClientAction.java:3<em>1</em>)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:606)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252)rn at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:<em>1</em>67)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:<em>1</em>38)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:<em>1</em>9<em>1</em>)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:9<em>1</em>)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:<em>1</em>00)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:<em>1</em>4<em>1</em>)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:<em>1</em>45)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:<em>1</em>7<em>1</em>)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.I<em>1</em>8nInterceptor.intercept(I<em>1</em>8nInterceptor.java:<em>1</em>6<em>1</em>)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:<em>1</em>64)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:<em>1</em>93)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rnrnrnrn[color=#FF0000]rn以上这些是异常信息,我确定我是执行这条语句出错:rnhibernateTemplate.get(Client.class, id);rn我也确定id有值 比如<em>1</em>000<em>1</em>是数值型int,rn百思不得其解,赐教!rn[/color]
求助:String index out of range: 0 !!!
[img=https://img<em>-</em>bbs.csdn.net/upload/20<em>1</em>606/27/<em>1</em>467029<em>1</em>38_584565.png][/img]rn当程序在执行这条语句时,报<em>String</em> <em>index</em> out of <em>range</em>: 0!!异常 但是自己也没有使用过数组之类的容器,求各位大大帮助,已经纠结两天了!
java.lang.StringIndexOutOfBoundsException: String index out of range: -6
在解析数据库中一个字段的数据的时候总是报数组越界这个错误,具体情况:rn数据库中有4W多条数据,我要比较a字段和b字段中是否有相同部分,用到了字符串的substring()方法rn我测试过多次,但每次报错的数据都不一样,都报数组越界的错。rnrnIR_SID IR_SRCNAME rn<em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em> <em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em>rn5963 JB 3540<em>-</em><em>1</em>983 ; rnrnrnIR_SID IR_SRCNAME rn<em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em> <em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em>rn72<em>1</em>6 JB/T 8648.2<em>-</em><em>1</em>997 ; rnrnIR_SRCNAME的数据是我要用substring()方法<em>处理</em>的数据,运行一次会报<em>处理</em>JB 3540<em>-</em><em>1</em>983出现数组越界的错,再重新运行一次会报<em>处理</em>JB/T 8648.2<em>-</em><em>1</em>997出现数组越界的错,运行多少次就会出现多少次不同的数据报错,并且都是数组越界,我的问题是[color=#FF0000]如果真的是某个数据或者某些数据在用substring()<em>处理</em>的时候有错的话应该是一直报错,为什么运行一次就报不同的数据有错呢?[/color]rnrn下面是具体代码:rn[code=Java]rnconn = DBConnectionManager.getInstance().getConnection();rn<em>String</em> sql = "select IR_SID,IR_URLTITLE,IR_SRCNAME from URLCONTENT";rnSQLHelper.conn = conn;rnlist = SQLHelper.ExecuteReader(sql, null);rnfor(int i = 0 ; i < list.size(); i ++)rnObject[] obj = (Object[]) list.get(i);rnid = Integer.parseInt(obj[0].to<em>String</em>());rnurltitle = ((<em>String</em>) obj[<em>1</em>]).trim();rnif(obj[2] == null||"".equals(((<em>String</em>) obj[2]).trim()))rn srcnames = "";rnelsern srcnames = ((<em>String</em>) obj[2]).trim();rnrn<em>String</em> titlenum = null;rn<em>String</em> newcol = "";rnif(!urltitle.contains("<em>-</em>"))rn urltitle = urltitle+"<em>-</em>";rnrn titlenum = (urltitle.substring(urltitle.lastIndexOf(" ")+<em>1</em>, urltitle.lastIndexOf("<em>-</em>"))).trim();rn if(srcnames!=null)rn <em>String</em>[] srcname = srcnames.split(";");rn for(int j = 0 ; j < srcname.length ; j ++)rn if(srcname[j]!=null&&srcname[j].length()!=0)rn if(!srcname[j].trim().contains("<em>-</em>"))rn srcname[j] = srcname[j].trim()+"<em>-</em>";rn rn rn <em>String</em> srcnum = (srcname[j].trim().substring(srcname[j].trim().lastIndexOf(" ")+<em>1</em>, srcname[j].trim().lastIndexOf("<em>-</em>"))).trim();rn if(srcnum.equals(titlenum))rn newcol = srcname[j].trim();rn rn rn rn rn rn updatesql.append("update URLCONTENT set col='"+newcol+"' where IR_SID="+id+";");rnrnconnect = DBConnectionManager.getInstance().getConnection();rnSQLHelper.conn = connect;rnSQLHelper.ExecuteNonQuerys(updatesql.to<em>String</em>(), null);rnSystem.out.println("执行完毕!");rn[/code]
Android studio:报错String index out of range: -1
问题: 最近开始使用Android studio,不是很熟悉,将系统的开发的一个apk导入到Android studio,提示以下错误: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:mergeDebugResources'. > <em>String</em> ind
String index out of range: 6
老是说 字符串索引超出范围 到底哪里错了????
字符串异常:String index out of range: -2
字符串异常:<em>String</em> <em>index</em> out of <em>range</em>: <em>-</em>2 使用字符sub<em>String</em>操作的时候,经常会出现一个<em>String</em> <em>index</em> out of <em>range</em>: <em>-</em><em>1</em>,这个是典型的下标越界,其实位置小于0,结束位置大于字符长度都会报 <em>-</em><em>1</em> 这个异常。 <em>-</em>2这个异常就比较少见了,但是可以确定,它是和<em>-</em><em>1</em>不同的异常,但是同样发生在sub<em>String</em>方法里面; 这个异常挺难触发的,...
【解决问题.思路篇】StringIndexOutOfBoundsException:String index out of range: -1
看到题目,就应该能想到应该是字符串过长引起的问题。下面咱们分析一下。 报错: 严重: Servlet.service()for servlet jsp threw exception java.lang.<em>String</em>IndexOutOfBoundsException:<em>String</em> <em>index</em> out of <em>range</em>: <em>-</em><em>1</em>           根据代码跟踪,发现是首页数据加载
java.lang.StringIndexOutOfBoundsException: String index out of range: 116
at java.lang.<em>String</em>.checkBounds(<em>String</em>.java:402)rnat java.lang.<em>String</em>.(<em>String</em>.java:443)rnat jxl.biff.<em>String</em>Helper.get<em>String</em>(<em>String</em>Helper.java:<em>1</em>64)rnat jxl.read.biff.WriteAccessRecord.(WriteAccessRecord.java:56)rnat jxl.read.biff.WorkbookParser.parse(WorkbookParser.java:82<em>1</em>)rnat jxl.Workbook.getWorkbook(Workbook.java:237)rnat jxl.Workbook.getWorkbook(Workbook.java:<em>1</em>98)rnat com.iedudata.action.AddStudentResultRecordAction.addExamResult(AddStudentResultRecordAction.java:454)rnat com.iedudata.action.AddStudentResultRecordAction.addStudentResultRecord(AddStudentResultRecordAction.java:89)rnat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rnat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rnat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rnat java.lang.reflect.Method.invoke(Method.java:597)rnat com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)rnat com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)rnat com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:22<em>1</em>)rnat com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:22<em>1</em>)rnat com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:<em>1</em>50)rnat org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)rnat com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:22<em>1</em>)rnat com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:<em>1</em>23)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:22<em>1</em>)rnat com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:<em>1</em>67)rnat com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:22<em>1</em>)rnat com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:<em>1</em>05)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:22<em>1</em>)rnat org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:22<em>1</em>)rnat org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:22<em>1</em>)rnat com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:22<em>1</em>)rnat com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:<em>1</em>27)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:22<em>1</em>)rnat org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:<em>1</em>07)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:22<em>1</em>)rnat org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:22<em>1</em>)rnat com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:<em>1</em><em>1</em>5)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:22<em>1</em>)rnat com.opensymphony.xwork2.interceptor.I<em>1</em>8nInterceptor.intercept(I<em>1</em>8nInterceptor.java:<em>1</em>43)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:22<em>1</em>) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:<em>1</em>2<em>1</em>) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:22<em>1</em>)rnat org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:<em>1</em>70)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:22<em>1</em>)rnat com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:<em>1</em>23)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:22<em>1</em>)rnat com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:<em>1</em>76)rn
String index out of range: -6 的错误
初次使用hibernate,然后将一个页面中的数据插入到数据库中时,就阴魂不散的发生了这个错误,我插入的值只是一位:“<em>1</em>”,却总是报这个错,有谁也碰到过这个问题吗?
救命啊!!!老是报java.lang.StringIndexOutOfBoundsException: String index out of range: 16?????
我在 往SQLSERVER中循环插入<em>1</em><em>-</em><em>1</em>000的ID的时候老是报java.lang.<em>String</em>IndexOutOfBoundsException: <em>String</em> <em>index</em> out of <em>range</em>: <em>1</em>6,代码如下:rn try rn // connection= DriverManager.getConnection(url<em>1</em><em>1</em>,user<em>1</em><em>1</em>,password<em>1</em><em>1</em>); rn connection.setAutoCommit(false);// 事物<em>处理</em> rn for(i=0;ialert('卡号[ "+qskh+" ]已存在,请确认你要添加的卡段!');self.history.back();"); rn elsern SQL="";rn SQL="insert into newcard(onlyid,card,lrfs,cardtype,nj,price,dls,ffsj,fffs,ffr) values('"+getOnlyID()+"','"+qskh+"','"+lrfs+"','"+cardtype+"','"+nj+"','"+price+"','未代理',GETDATE(),'"+fffs+"','"+ddd+"')";rn connection= DriverManager.getConnection(url<em>1</em><em>1</em>,user<em>1</em><em>1</em>,password<em>1</em><em>1</em>); rn stmt=connection.createStatement();rn iTmp=stmt.executeUpdate(SQL); rn SQL="";rn rn qskh<em>1</em>=qskh<em>1</em>+<em>1</em>;rn qskh=<em>String</em>.valueOf(qskh<em>1</em>);rn SQL=""; rn rn if(iTmp>0)rn out.println(" ");rn elsern out.println(" ");rn rn rn catch(SQLException e)rn out.print(e);rn connection.rollback();rn
string subscript out of range
我使用rntemp.erase(temp.end()<em>-</em><em>1</em>);rn后编译时没错,运行时出现RT错误!高手帮忙啊!
dbGrid index out of range怎么解决
我利用adoquery控减连接数据库。用dbgrid空件显示内容,但是如果数据库中的纪录超过了一定的数量的时候,救护出现错误:代码如下:rngrid <em>index</em> out of <em>range</em>rnrn我知道是dbgrid控减的问题,从那里可以设置dbgrid空间的范围属性。
关于String index out of range: -1报错问题
<em>String</em> <em>index</em> out of <em>range</em>: <em>-</em><em>1</em> 这个异常一般是截取字符串时报的错误。 后台生成图片名称: <em>String</em> fileName = number0+number<em>1</em>+number2+System.currentTimeMillis()+fi.getName().substring(fi.getName().<em>index</em>Of(".")); 当fi中不存在name 或者 n
String index out of range: 0
<em>String</em> <em>index</em> out of <em>range</em>: 0 异常信息 是字符串下标越界 导致这个问题的原因有 很多 我这边的是 mysql数据中的一个字段是char类型值为空导致的 为什么会这样呢? 百度了一下 感觉一个大神的回答相对靠谱点 这个要从char类型和string类型的数据来看。 char类型是值类型,存在在栈上,在编译时要求分配内存,所以必须为其赋初值,其他值类型如int,do...
Java String index out of range: -1
出现这个异常,对应的位置加上 if (sax.lastIndexOf("字符")!=<em>-</em><em>1</em>){ ...... }
String index out of range: -824264796 不明的原因导致驱动程序造成失败,请回报这个例外。
报错 20<em>1</em>8<em>-</em>08<em>-</em>27 <em>1</em><em>1</em>:26:57.307 ERROR 7<em>1</em>88 <em>-</em><em>-</em><em>-</em> [eate<em>-</em><em>1</em>0<em>1</em>6098<em>1</em><em>1</em>4] com.alibaba.druid.pool.DruidDataSource : create connection SQLException, url: jdbc:postgresql://<em>1</em>92.<em>1</em>68.<em>1</em><em>1</em>.2<em>1</em>:5432/timescaledb_hdb?cha...
String out of range : 1303128
engineurl:http://<em>1</em>27.0.0.<em>1</em>2:8888/transrnparameterKey:config=BR&Code=0<em>1</em>0&x<em>1</em>=<em>1</em><em>1</em>6.8<em>1</em>09<em>1</em>8&y<em>1</em>=39.9<em>1</em>27<em>1</em>9&x2=<em>1</em>2<em>1</em>.60<em>1</em>8793&y2=38.8028643&routeType=0&language=cn&ver=2.0rnjava.lang.<em>String</em>IndexOutOfBoundsException: <em>String</em> <em>index</em> out of <em>range</em>: <em>1</em>303<em>1</em>28rn at java.lang.<em>String</em>.checkBounds(<em>String</em>.java:40<em>1</em>)rn at java.lang.<em>String</em>.(<em>String</em>.java:442)rn at com.mapabc.sis.server.core.service.impl.BusRouteServiceImpl.byteTo<em>String</em>(BusRouteServiceImpl.java:3<em>1</em>3)rn at com.mapabc.sis.server.core.service.impl.BusRouteServiceImpl.format2NewBusRouteBeans(BusRouteServiceImpl.java:<em>1</em>83)rn at com.mapabc.sis.server.core.service.impl.BusRouteServiceImpl.invokeService(BusRouteServiceImpl.java:72)rn at com.mapabc.sis.server.core.service.CoreServices.processRequest(CoreServices.java:<em>1</em>92)rn at com.mapabc.sis.server.core.service.CoreServices.doGet(CoreServices.java:343)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:6<em>1</em>7)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:7<em>1</em>7)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at com.mapabc.sis.server.core.security.SecurityFilter.doFilter(SecurityFilter.java:279)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)rn at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)rn at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)rn at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)rn at com.mapabc.sis.server.core.access.LBSServer.urlforward(LBSServer.java:<em>1</em>96)rn at com.mapabc.sis.server.core.access.LBSServer.doGet(LBSServer.java:93)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:6<em>1</em>7)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:7<em>1</em>7)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:<em>1</em>9<em>1</em>)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:<em>1</em>27)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:<em>1</em>02)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:<em>1</em>09)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)rn at org.apache.coyote.http<em>1</em><em>1</em>.Http<em>1</em><em>1</em>Processor.process(Http<em>1</em><em>1</em>Processor.java:857)rn at org.apache.coyote.http<em>1</em><em>1</em>.Http<em>1</em><em>1</em>Protocol$Http<em>1</em><em>1</em>ConnectionHandler.process(Http<em>1</em><em>1</em>Protocol.java:588)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)rn at java.lang.Thread.run(Thread.java:662)rnjava.lang.NullPointerExceptionrn at com.mapabc.sis.util.coordsfactory.action.BusRouteCoords.invokeCoords(BusRouteCoords.java:42)rn at com.mapabc.sis.server.core.service.CoreServices.processRequest(CoreServices.java:2<em>1</em><em>1</em>)rn at com.mapabc.sis.server.core.service.CoreServices.doGet(CoreServices.java:343)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:6<em>1</em>7)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:7<em>1</em>7)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at com.mapabc.sis.server.core.security.SecurityFilter.doFilter(SecurityFilter.java:279)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)rn at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)rn at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)rn at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)rn at com.mapabc.sis.server.core.access.LBSServer.urlforward(LBSServer.java:<em>1</em>96)rn at com.mapabc.sis.server.core.access.LBSServer.doGet(LBSServer.java:93)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:6<em>1</em>7)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:7<em>1</em>7)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:<em>1</em>9<em>1</em>)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:<em>1</em>27)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:<em>1</em>02)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:<em>1</em>09)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)rn at org.apache.coyote.http<em>1</em><em>1</em>.Http<em>1</em><em>1</em>Processor.process(Http<em>1</em><em>1</em>Processor.java:857)rn at org.apache.coyote.http<em>1</em><em>1</em>.Http<em>1</em><em>1</em>Protocol$Http<em>1</em><em>1</em>ConnectionHandler.process(Http<em>1</em><em>1</em>Protocol.java:588)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)rn at java.lang.Thread.run(Thread.java:662)rnsum time=9556rnrnrn我在运行服务时tomcat出现如下提示,但是服务并没发生中断之类的错误。这个问题是什么原因导致呢。该如何解决呢
list index out of range 求解
import os,re,linecacherndef fun(path):rn for root,dirs,files in os.walk(path):rn for fn in files:rn rootpath = os.path.join(root,fn)rn filetype=fn.split('.')[<em>1</em>]rn if filetype in['xml']:rn print(rootpath) rn new=(linecache.getline(rootpath,4)).rstrip()rn print (new)rn #print (type(new))rn newsp=new.split('.')rn #print (type(newsp))rn print(newsp[<em>1</em>])rn f= open(rootpath,'r+')rn d=f.read()rn open(rootpath, 'w').write(re.sub(r'a', 'b', d))rn f.close()rn else:rn continuernfun(r'C:\wmpub')rnrnrnrnC:\wmpub\a.xmlrnrnTraceback (most recent call last):rn File "C:\Documents and Settings\Administrator\桌面\test.py", line 2<em>1</em>, in rn fun(r'C:\wmpub')rn File "C:\Documents and Settings\Administrator\桌面\test.py", line <em>1</em>4, in funrn print(newsp[<em>1</em>])rnIndexError: list <em>index</em> out of <em>range</em>rn>>>
Row index out of range问题
public class Table<em>1</em> extends JFramern <em>String</em> rid[] = new <em>String</em>[<em>1</em>00];rn int count = 0;rn /*rn * public static void main(<em>String</em> a[]) new Table<em>1</em>(); rn */rn rn public void center(JFrame frame) rn double x = frame.getWidth(); // 居中困难rn double y = frame.getHeight();rn Toolkit kit = Toolkit.getDefaultToolkit();rn Dimension screenSize = kit.getScreenSize();rn double xx = screenSize.getWidth();rn double yy = screenSize.getHeight();rn frame.setLocation((int) (xx / 2 <em>-</em> x / 2), (int) (yy / 2 <em>-</em> y / 2));rn rn public Table<em>1</em>() rn JPanel zuida = new JPanel(new BorderLayout(0, <em>1</em>0));rn JPanel jp<em>1</em> = fangzi();rn JPanel jp2 = dingdan();rn jp2.setBorder(BorderFactory.createTitledBorder("订单信息"));rn JTabbedPane tp = new JTabbedPane();rn tp.addTab("房间预定", jp<em>1</em>);rn tp.addTab("订单信息", jp2);rn // zuida.add(jp<em>1</em>);rn zuida.add("North", tp);rn JFrame frame = new JFrame("酒店");rn frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);rn //zuida.setBackground(new Color(<em>1</em>02,204,255)); 设置背景颜色rn zuida.setBorder(new EmptyBorder(5, 5, 5, 5));rn frame.setContentPane(zuida);rn frame.setVisible(true);rn frame.pack();rn center(frame);rn System.out.println("<em>1</em>23");rn // frame.setLocationRelativeTo(null);//这个也是居中的方法rn rn JPanel fangzi() rn JTable jiu = jiudian();rn JTable table = order();rn JScrollPane pane = new JScrollPane(jiu); // 加滑轮rn JPanel panel = new JPanel();//rn JPanel panel2 = new JPanel(new FlowLayout(FlowLayout.CENTER, 30, <em>1</em>0));rn JPanel panel3 = new JPanel(new GridLayout(<em>1</em>, <em>1</em>0));rn JPanel panel4 = new JPanel(new BorderLayout(0, <em>1</em>0));rn panel.setPreferredSize(new Dimension(600, 400));rn panel.setLayout(new BorderLayout());rn JButton b<em>1</em> = new JButton("预订");rn JButton b2 = new JButton("加至购物车");rn JButton b3 = new JButton("预定多个");rn JButton b4 = new JButton("生成订单");rn panel2.add(b<em>1</em>);rn panel2.add(b2);rn panel2.add(b3);rn panel2.add(b4);rn ButtonListener bListener = new ButtonListener(jiu,rid);rn rn JButton b5 = new JButton("查询空房");rn panel3.add(b5);rn rn rn bListener.jPanel = panel;rn bListener.jPanel2 = pane;rn ButtonListener bListener2 = new ButtonListener(table);rn b5.addActionListener(bListener2);rn rn b<em>1</em>.addActionListener(bListener);rn b2.addActionListener(bListener);rn b3.addActionListener(bListener);rn b4.addActionListener(bListener);rnrn panel.add("Center", pane);rn panel.add("South", panel2);rn panel.add("North", panel3);rn panel.setBorder(BorderFactory.createTitledBorder("房间信息"));rn rn rn rn return panel;rn rn JPanel dingdan() rn JTable dingdan = order();rn JScrollPane pane = new JScrollPane(dingdan);rn JPanel jp<em>1</em>0 = new JPanel(new BorderLayout());rn jp<em>1</em>0.add("Center", pane);rn JButton b<em>1</em> = new JButton("确定");rn JButton b2 = new JButton("刷新");rn jp<em>1</em>0.add("South", b<em>1</em>);rn jp<em>1</em>0.add("North",b2);rn ButtonListener bListener<em>1</em> = new ButtonListener(dingdan);rn b<em>1</em>.addActionListener(bListener<em>1</em>);rn b2.addActionListener(bListener<em>1</em>);rn return jp<em>1</em>0;rn rn JTable order() //生成订单的表格rn Vector lieV = new Vector();rn Vector hangV = new Vector();rn try rn Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");rn Connection con;rn con = DriverManager.getConnection("jdbc:sqlserver://localhost:<em>1</em>433;DataBaseName=Hotel", "sa", "<em>1</em>23");rn PreparedStatement statement = con.prepareStatement("Select * from 订单 where Userid =? ");rn statement.set<em>String</em>(<em>1</em>, new MainClass().getname());rn ResultSet rs = statement.executeQuery();rn while (rs.next()) rn Vector hangv = new Vector();rn hangv.add(Integer.parseInt(rs.get<em>String</em>(<em>1</em>)));rn hangv.add(rs.get<em>String</em>(2)); rn hangv.add((rs.get<em>String</em>(3))); rn hangv.add((rs.get<em>String</em>(4))); rn hangv.add((rs.getInt(5))); rn hangv.add((rs.get<em>String</em>(6))); rn hangv.add((rs.getInt(7)));rn hangV.add(hangv);rn rn catch (Exception e) rn System.out.println("Error" + e);rn rn final Object Lie[] = "订单编号", "用户", "房间编号", "订单日期","数量", "状态","价格" ;rn lieV.add("订单编号");rn lieV.add("用户");rn lieV.add("房间编号");rn lieV.add("订单日期");rn lieV.add("数量");rn lieV.add("状态");rn lieV.add("价格");rn rn //JTable jiu = new JTable(row, Lie); // 建立表格rn DefaultTableModel tableModel = new DefaultTableModel(hangV, lieV);rn JTable jiu = new JTable(tableModel); rn jiu.setPreferredScrollableViewportSize(new Dimension(400, 300));rn jiu.setRowHeight(30);rn jiu.setRowMargin(5);rn jiu.setRowSelectionAllowed(true);rn jiu.setSelectionBackground(Color.WHITE);rn jiu.setSelectionForeground(Color.red);rn jiu.setGridColor(Color.BLACK);rn // jiu.selectAll();rn jiu.setRowSelectionInterval(0, 0);rnrn //jiu.clearSelection();rn jiu.setDragEnabled(false);rn jiu.setShowGrid(true);rn jiu.setShowHorizontalLines(false);rn jiu.setShowVerticalLines(false);rn //jiu.doLayout();rn jiu.setBackground(Color.LIGHT_GRAY);rn //ButtonListener bListener = new ButtonListener(jiu, rid);rn //bListener.otherTable = jiu;rn return jiu;rn rn //!!!!rn JTable jiudian() //生成酒店的表格 rn // 用向量来实现动态的大小rn //Object 可以不用了rn Vector lieV = new Vector();rn Vector hangV = new Vector();rn Object row[][] = new Object[30][30];rn try rn Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");rn Connection con;rn con = DriverManager.getConnection("jdbc:sqlserver://localhost:<em>1</em>433;DataBaseName=Hotel", "sa", "<em>1</em>23");rn Statement statement = con.createStatement();rn ResultSet rs = statement.executeQuery("Select * from 房间");rn int x = 0;rn int y = 0;rn rn while (rs.next()) rn Vector hangv = new Vector();rn row[x][y] = Integer.parseInt(rs.get<em>String</em>("rid"));rn hangv.add(row[x][y]);rn y++;rn row[x][y] = rs.getInt("Rprice");rn hangv.add(row[x][y]);rn y++;rn row[x][y] = (rs.get<em>String</em>("raddress"));rn hangv.add(row[x][y]);rn y++;rn row[x][y] = (rs.get<em>String</em>("rtype"));rn hangv.add(row[x][y]);rn y++;rn row[x][y] = (rs.get<em>String</em>("rstate"));rn hangv.add(row[x][y]);rn x++;rn y = 0;rn hangV.add(hangv);rn rn catch (Exception e) rn System.out.println("Error" + e);rn rn final Object Lie[] = "编号", "价格", "位置", "类型", "状态" ;rn lieV.add("编号");rn lieV.add("价格");rn lieV.add("位置");rn lieV.add("类型");rn lieV.add("状态");rn rn //JTable jiu = new JTable(row, Lie); // 建立表格rn DefaultTableModel tableModel = new DefaultTableModel(hangV, lieV);rn JTable jiu = new JTable(tableModel); rn jiu.setPreferredScrollableViewportSize(new Dimension(400, 300));rn jiu.setRowHeight(30);rn jiu.setRowMargin(5);rn jiu.setRowSelectionAllowed(true);rn jiu.setSelectionBackground(Color.WHITE);rn jiu.setSelectionForeground(Color.red);rn jiu.setGridColor(Color.BLACK);rn // jiu.selectAll();rn jiu.setRowSelectionInterval(0, 0);rnrn //jiu.clearSelection();rn jiu.setDragEnabled(false);rn jiu.setShowGrid(true);rn jiu.setShowHorizontalLines(false);rn jiu.setShowVerticalLines(false);rn jiu.doLayout();rn jiu.setBackground(Color.LIGHT_GRAY);rnrn return jiu;rn rnrnrnrnrnErrorjava.lang.IllegalArgumentException: Row <em>index</em> out of <em>range</em>rn实在不知道怎么修改rn
Parameter index out of range 谢谢!
谢谢大家!帮我看看这个错误怎么回事,谢谢!!rnrnjava.sql.SQLException: Parameter <em>index</em> out of <em>range</em> (<em>1</em> > number of parameters, which is 0).rn at com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:2493)rn at com.mysql.jdbc.PreparedStatement.set<em>String</em>(PreparedStatement.java:32<em>1</em>3)rn at database.LinkDB.addBook(LinkDB.java:35)rn at action.addBookAction.execute(addBookAction.java:37)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:42<em>1</em>)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:<em>1</em><em>1</em>64)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:4<em>1</em>5)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:<em>1</em>73)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:2<em>1</em>3)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:<em>1</em>78)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:<em>1</em>26)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:<em>1</em>05)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:<em>1</em>07)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:<em>1</em>48)rn at org.apache.coyote.http<em>1</em><em>1</em>.Http<em>1</em><em>1</em>Processor.process(Http<em>1</em><em>1</em>Processor.java:856)rn at org.apache.coyote.http<em>1</em><em>1</em>.Http<em>1</em><em>1</em>Protocol$Http<em>1</em><em>1</em>ConnectionHandler.processConnection(Http<em>1</em><em>1</em>Protocol.java:744)rn at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)rn at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)rn at java.lang.Thread.run(Thread.java:595)rn
out of range 怎么解决啊????????
我在安装RADHAT9和红旗5时都出现OUT OF RANGE显示器也黑屏!!!!rn在网上查到是显卡还是显示器的问题!!rn请问怎么解决啊!!??????????rn
报错String index out of range是什么意思?在线等
报错<em>String</em> <em>index</em> out of <em>range</em>是什么意思?在线等
[转] hibernate String index out of range: 0 错误及解决方案
原文链接: https://my.oschina.net/liujiawan/blog/5<em>1</em>5203 状况: 当查询的数据库字段值为空字符窜的时候,会报这种错误, 猜测这是因为hibernate某种奇怪的设定的原因 java.lang.<em>String</em>IndexOutOfBoundsException: <em>String</em> <em>index</em> out of <em>range</em>: 0 解决方案:...
String index out of range: -14
public class GetLatAndLngByBaidu { /** * @param addr * 查询的地址 * @return * @throws IOException */ publ
string subscript out of range! 急!!!!
rn编译程序出现的Assert问题!rn弹出一个Visual C++ Debug Library错语!rnrn错误点:rnrnQueryInterface()查找接口时,请问这程情况一般是什么问题!?
求助:string subscript out of range
新手求助!rn//Main.cpprn#include rn#include rn#include rn#include rnint main()rnrn using namespace std;rn ofstream outFile;rn outFile.open("可修复装备.txt");rn ifstream inFile;rn inFile.open("Commodity.ini");rn if (!inFile.is_open())rn rn cout <<
String index out of range:6 请问这个错误信息是什么意思
<em>String</em> <em>index</em> out of <em>range</em>:6 请问这个错误信息是什么意思rnrn那位高手能给点意见阿
怎么会出现String index out of range: 25的情况?
我用以下语句时:if(content.length()>30) title=title.substring(0,25)+"...";怎么出现了<em>String</em> <em>index</em> out of <em>range</em>: 25的情况!这是什么问题所引起的?有进好像又不会出现这种问题。请高手指点。
(上传问题)java.lang.StringIndexOutOfBoundsException: String index out of range: -63657
大家好! 小弟为这事苦恼许久。rnrnjava.lang.<em>String</em>IndexOutOfBoundsException: <em>String</em> <em>index</em> out of <em>range</em>: <em>-</em>63657rnrn错误原因是上传文件导致的。rnrn上传组件:jspSmartUpload.jarrnrn测试图片:pic0<em>1</em>.jpgrnrn分辨率为:400×400rnrn大小:66.<em>1</em> KB (67,704 字节)rnrn占用:80.0 KB (8<em>1</em>,920 字节)rnrn本地测试上传,没有错误。但是将程序上传到服务器后,在服务器上测试的时候个别图片就会报错。rnrn不知道大家有没有碰到过这类事情?rnrn请帮小弟解惑! 在此谢过了!
Gradle:String index out of range: 0
Received result Failure[value=org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: <em>String</em> <em>index</em> out of <em>range</em>: 0]早上来merge代码后,gradle sync就报<em>String</em> <em>index</em> out
多文件上传的 问题 String index out of range: -1在线等!
我做了一个多文件的上传,但是测试的是总是提醒我这样的话<em>String</em> <em>index</em> out of <em>range</em>: <em>-</em><em>1</em> 不知道是什么意思,希望大家帮帮,代码在这!哪个地方需要改进 public Action
Android Studio Error String index out of range 0 字符串索引超出范围
Android Studio Error <em>String</em> <em>index</em> out of <em>range</em> 0 字符串索引超出范围
求救Tomcat4.04 + jdk1.4.0 遇到 String index out of range: 23
程序如下rnrnrnrn rnrnrn rnrnrnrnrnrnrnrnrnrnrnrnrn每刷新3次到4次出现如下错误,rnrnApache Tomcat/4.0.4 <em>-</em> HTTP Status 500 <em>-</em> Internal Server Errorrnrn<em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em><em>-</em>rnrntype Exception reportrnrnmessage Internal Server Errorrnrndescription The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.rnrnexception rnrnjava.lang.<em>String</em>IndexOutOfBoundsException: <em>String</em> <em>index</em> out of <em>range</em>: 23rn at java.lang.<em>String</em>.substring(<em>String</em>.java:<em>1</em>473)rn at org.apache.jsp.time$jsp._jspService(time$jsp.java:68)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:<em>1</em>07)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)rn at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:20<em>1</em>)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:38<em>1</em>)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:<em>1</em>93)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:<em>1</em>90)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:<em>1</em>80)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:<em>1</em>70)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:<em>1</em>70)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:<em>1</em>74)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:<em>1</em>027)rn at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:<em>1</em><em>1</em>25)rn at java.lang.Thread.run(Thread.java:536)rnrn
javax.servlet.ServletException: String index out of range: 10这是什么原因
同一种类别下面有按照xx,yy,zz等等搜索,有时输入xx是出现上述错误,有时输入yy时出现上述错误,这是什么原因,该如何解决啊?谢谢大哥们指教
out of range 怎么解决?
装的是fc4,用的是图形界面,可能是设置显示的时候出错,现在进入系统不到3秒种,显示器就显示out of <em>range</em>,我该怎样设置才能设置成合适的频率
String index out of 4解决方法
<em>String</em> <em>index</em> out of 4解决方法
关于Grid Index Out Of Range 的问题
我在窗体中添加了一个PageContol组件,通过切换PageContol的页面来实现不同数据表的全部记录显示,代码如下rnprocedure TForm2.PageControl<em>1</em>Change(Sender: TObject);rnbeginrn if pagecontrol<em>1</em>.TabIndex=0 thenrn beginrn datamodule<em>1</em>.ADOQuery2.Close;rn with datamodule<em>1</em>.ADOQuery<em>1</em> dorn beginrn close;rn sql.Clear;rn sql.Add('select * from 年度培训计划表 order by 年度, 编号 ASC');rn open;rn last;rn end;rn DBGrid<em>1</em>.DataSource:=datamodule<em>1</em>.DataSource<em>1</em>;rn DBNavigator<em>1</em>.DataSource:=datamodule<em>1</em>.DataSource<em>1</em>;rn end;rn if pagecontrol<em>1</em>.TabIndex=<em>1</em> thenrn beginrn datamodule<em>1</em>.ADOQuery<em>1</em>.Close;rn with datamodule<em>1</em>.ADOQuery2 dorn beginrn close;rn sql.Clear;rn sql.Add('select * from 计划外培训项目表 order by 编号 ASC');rn open;rn last;rn end;rn DBGrid<em>1</em>.DataSource:=datamodule<em>1</em>.DataSource2;rn DBNavigator<em>1</em>.DataSource:=datamodule<em>1</em>.DataSource2;rn end;rnend;rn窗体显示时Pagecontrol的Tab<em>index</em>为0,代码如下:rnprocedure TForm2.FormShow(Sender: TObject);rnbeginrn dbgrid<em>1</em>.DataSource:=datamodule<em>1</em>.DataSource<em>1</em>;rn dbnavigator<em>1</em>.DataSource:=datamodule<em>1</em>.DataSource<em>1</em>;rn with datamodule<em>1</em>.ADOQuery<em>1</em> dorn beginrn close;rn sql.Clear;rn sql.Add('select * from 年度培训计划表 order by 年度, 编号 ASC');rn open;rn last;rn end;rnend;rnrn然后我又增加了一个按钮,点击时显示表的全部记录,代码如下:rnprocedure TForm2.QueryAllClick(Sender: TObject);rnbeginrn if pagecontrol<em>1</em>.TabIndex=0 thenrn beginrn datamodule<em>1</em>.ADOQuery2.Close;rn with datamodule<em>1</em>.ADOQuery<em>1</em> dorn beginrn close;rn sql.Clear;rn sql.Add('select * from 年度培训计划表 order by 年度, 编号 ASC');rn open;rn last;rn end;rn DBGrid<em>1</em>.DataSource:=datamodule<em>1</em>.DataSource<em>1</em>;rn DBNavigator<em>1</em>.DataSource:=datamodule<em>1</em>.DataSource<em>1</em>;rn end;rn if pagecontrol<em>1</em>.TabIndex=<em>1</em> thenrn beginrn datamodule<em>1</em>.ADOQuery<em>1</em>.Close;rn with datamodule<em>1</em>.ADOQuery2 dorn beginrn close;rn sql.Clear;rn sql.Add('select * from 计划外培训项目表 order by 编号 ASC');rn open;rn last;rn end;rn DBGrid<em>1</em>.DataSource:=datamodule<em>1</em>.DataSource2;rn DBNavigator<em>1</em>.DataSource:=datamodule<em>1</em>.DataSource2;rn end;rnend;rnrn现在的问题在于,当窗体显示时,我点击该按钮,就会出错,弹出出现异常:Grid <em>index</em> out of <em>range</em> 。rn利用F7跟踪调试,发现错误在last这条语句上。rnrn我搞了半天也没弄明白为什么会出错,敬请大家赐教!!!!!!
关于hibernate中出现 String index out of range: -1 求大神
我就是插入个数据而已嘛 请问哪越界了 public class HibernateTest { private static SessionFactory sessionFactory; static
MyBatis使用Mapper查询时报错:java.lang.StringIndexOutOfBoundsException: String index out of range: 8000
SpringBoot项目做订单查询接口开发,使用Mybatis的Mapper做查询的时候,抛出异常 java.lang.<em>String</em>IndexOutOfBoundsException: <em>String</em> <em>index</em> out of <em>range</em>: 8000 错误信息指向了响应查询请求的Controller之后没有更具体的错误信息,一路跟踪,最后指向我定义的mapper的查询方法,但是我这个方法内没看到...
String index out of range" 问题">遇到的一个"String index out of range" 问题
原来   substring
StringIndexOutOfBoundsException: String index out of range: -1">null和"null",java.lang.StringIndexOutOfBoundsException: String index out of range: -1
这个报错表示使用string的<em>index</em>Of的时候没有找到对应的<em>index</em>,下标越界了(https://zhidao.baidu.com/question/306567663.html) 比如我从一个jsonObject或者map中通过get("key")来获取一个值,但是这个key其实不存在,结果其实是null 但是我用+"",将值变成了<em>String</em>类型,就会导致null拦截不到空数据,并且...
让人迷糊的String index out of Range??新手求解
public int Run(<em>String</em> s) { int len = s.length(); //字符串长度len int n=0; int i=<em>1</em>; for (i=<em>1</em>;i<=len;i++)
index out of range"提示......">又一个"Grid index out of range"提示......
为何我的Adoquery增加记录有时会出现"Grid <em>index</em> out of <em>range</em>"?何解?
求助:IndexError: list index out of range
使用Spyder(python 3.6)代码为:rn#!/usr/bin/env python3rnimport sysrnrnfrom xlrd import open_workbookrnfrom xlwt import Workbookrnrninput_file = sys.argv[<em>1</em>]rnoutput_file = sys.argv[2]rnrnoutput_workbook = Workbook()rnoutput_worksheet = output_workbook.add_sheet('jan_20<em>1</em>3_output')rnrnwith open_workbook(input_file) as workbook:rn worksheet = workbook.sheet_by_name('january_20<em>1</em>3')rn for row_<em>index</em> in <em>range</em>(worksheet.nrows):rn for column_<em>index</em> in <em>range</em>(worksheet.ncols):rn output_worksheet.write(row_<em>index</em>, column_<em>index</em>, worksheet.cell_value(row_<em>index</em>, column_<em>index</em>))rnoutput_workbook.save(output_file)rnrn执行:python 2excel_parsing_and_write.py sale_20<em>1</em>3 Loutput.xlsrnrn出现问题,输出;rnPython 3.6.2 |Anaconda custom (64<em>-</em>bit)| (default, Sep <em>1</em>9 20<em>1</em>7, 08:03:39) [MSC v.<em>1</em>900 64 bit (AMD64)]rnType "copyright", "credits" or "license" for more information.rnrnIPython 6.<em>1</em>.0 <em>-</em><em>-</em> An enhanced Interactive Python.rnrnrnrnrunfile('C:/LearnPython/excel/2excel_parsing_and_write.py', args='sales_20<em>1</em>3.xlsx', wdir='C:/LearnPython/excel')rnTraceback (most recent call last):rnrn File "", line <em>1</em>, in rn runfile('C:/LearnPython/excel/2excel_parsing_and_write.py', args='sales_20<em>1</em>3.xlsx', wdir='C:/LearnPython/excel')rnrn File "H:\ProgramData\Anaconda3\lib\site<em>-</em>packages\spyder\utils\site\sitecustomize.py", line 7<em>1</em>0, in runfilern execfile(filename, namespace)rnrn File "H:\ProgramData\Anaconda3\lib\site<em>-</em>packages\spyder\utils\site\sitecustomize.py", line <em>1</em>0<em>1</em>, in execfilern exec(compile(f.read(), filename, 'exec'), namespace)rnrn File "C:/LearnPython/excel/2excel_parsing_and_write.py", line 8, in rn output_file = sys.argv[2]rnrnIndexError: list <em>index</em> out of <em>range</em>
关于“Grid index out of range”的问题
我的程序rn <em>1</em>)所用控件rn TDBGrid *DBGrid<em>1</em>;rn TDBNavigator *DBNavigator<em>1</em>;rn TDataSource *DSSQL;rn TQuery* Query<em>1</em>;rn 2)控年设置rn DSSQL<em>-</em>>DataSet = Query<em>1</em>;rn DBNavigator<em>1</em><em>-</em>>DataSource = DSSQL;rn DBGrid<em>1</em><em>-</em>>DataSource = DSSQL;rnrn 3)出错的情况rn 3<em>-</em><em>1</em>) 第一次执行rnrn Query<em>1</em><em>-</em>>Close();rn Query<em>1</em><em>-</em>>SQL<em>-</em>>Clear();rn Query<em>1</em><em>-</em>>SQL<em>-</em>>Add("select * from aa where qsOpen():rnrn 然后点击DBNavigator<em>1</em>控件的“Last”按钮,程序正常rn 3<em>-</em>2)第二次执行rnrn Query<em>1</em><em>-</em>>Close();rn Query<em>1</em><em>-</em>>SQL<em>-</em>>Clear();rn Query<em>1</em><em>-</em>>SQL<em>-</em>>Add("select * from aa where qsOpen():rnrn 然后点击DBNavigator<em>1</em>控件的“Last”按钮,程序报“Grid <em>index</em> out of <em>range</em>”错. 点警告框的“确定”按钮后,进入C++Builder的调试状态,不作任何变动,直接rn“RUN”按钮,回到程序运行状态,再按DBNavigator<em>1</em>控件的“Last”按钮,程序又正常。rn 以后每再次重新用SQL查询后,想到数据集的最后一条记录(用语句Query<em>1</em><em>-</em>>Last();也一样),非要出次错,才会正常,不知是何道理,不知有何对策,我估计是DBGrid<em>1</em>的设置有误,但不知具体原因。rn 请赐教,rn为感!!rnrnrn
index out of range"">dbgird控件---->"grid index out of range"
我在用dbgird控件时, 当dbgird的宽度变大到一定程度, 当点击insert键插入信息时就出错,信息如下:rn"grid <em>index</em> out of <em>range</em>"  如何解决???什么原因???
Grid Index out of Range (TDBAdvGrid/D7)
我知道这个是表格索引越界了,可是dbGrid有没有办法不通过代码只是通过控件设置就可以自动添加记录呢?rnrn顺便请教一个问题,某个数字字段,要求值在2000<em>-</em>500000,dbGrid的输入格可以直接设置只接受符合条件的输入吗?
新手求助java.lang.StringIndexOutOfBoundsException: String index out of range: -1
严重: Servlet.service() for servlet jsp threw exception java.lang.<em>String</em>IndexOutOfBoundsException: Str
String index out of range: -1 异常,急需处理
vt的大小是<em>1</em>0 点击页面查询数据第<em>1</em>0次的时候会出现<em>String</em> <em>index</em> out of <em>range</em>: <em>-</em><em>1</em> 异常 头疼死了,希望牛人能给解决一下 [code=&quot;java&quot;] alert(&quot;&quot;); //조회 후 데이타 없음 메세지 var val = new Array(); ...
String index out of range: -91 怎么解决?
<em>String</em> files = " Uin=<em>1</em>072, UserName=林立, Addr=XXXX:<em>1</em>047, Action=login, Mode=local, Result=0(success)\
string index out of range字符串怎么越界了?
打印出来s.encode('hex')是 0300 但是打印s却报下面错误? string <em>index</em> out of <em>range</em>
提示string subscript out of range
int main() { int i, j; string _strIn; vector>stu; //動的な二次元vector配列stuを宣言する vector<str
delphi6 'grid index out of range' 'TDBNavigator'
TDBGrid可以顯示資料rn我使用TDBNavigator去控制TDBGrid的上一筆跟下一筆還有最後一筆跟第一筆rnrn執行時,如果先案最後一筆rn他就會出現Grid <em>index</em> out of <em>range</em>rnrn如果今天先按下一筆再案最後一筆,程式就可以很順利的執行rn請問rn這是什麼原因??rnrn我有網查了,說要去檢查<em>index</em>是不是 0 到 Count <em>-</em> <em>1</em> 的数值rn想請問一下哪一個的<em>index</em>是TQUERY還是TDBGRID還是??
SSRS 2008 “Index was out of range…” Error
sql server report从05升级到08,查看报表出现如下问题,在05下看没有任何问题,大虾解决!!!rnrn客户端呈现期间出错。rnIndex was out of <em>range</em>. Must be non<em>-</em>negative and less than the size of the collection. Parameter name: <em>index</em>
脚本报错:IndexError: list index out of range
[code=Python]j=0rnd=os.listdir(DBDIR)rnfor j in <em>range</em>(0,len(d)<em>-</em><em>1</em>):rn if d[j][<em>-</em>3:] != 'sql':rn del d[j][/code]rnrnrn这段代码为什么总是报IndexError: list <em>index</em> out of <em>range</em>啊rnrn调试了一下,发现出错后,j的值是30<em>1</em>rnrn但我led(d)值是300,我已经限制<em>range</em>(0,299),为什么j值会超出啊rn
Gridview删除的时候提示Index was out of range
[code=HTML]rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn[/code]rnrn[code=C#]rnprotected void Page_Load(object sender, EventArgs e)rn rn if (!IsPostBack)rn rn showdata(0);rn rn rnrn //显示数据rn protected void showdata(int pageIndex)rn rn SqlConnection sqlcon;rn string strCon = ConfigurationSettings.AppSettings["Connection<em>String</em>"];rn string sqlstr = "select * from tjnews where type='发表文章' or type='实验室活动'";rn sqlcon = new SqlConnection(strCon);rn SqlDataAdapter myda = new SqlDataAdapter(sqlstr, sqlcon);rn DataSet myds = new DataSet();rn sqlcon.Open();rn myda.Fill(myds, "tjnews");rn DataView view = myds.Tables["tjnews"].DefaultView;rn string sort = "date desc,id desc";rn view.Sort = sort;rnrn GridView<em>1</em>.DataKeyNames = new string[] "id" ;//不加这个不能执行"删除"功能rn GridView<em>1</em>.DataSource = view;rn GridView<em>1</em>.PageIndex = pageIndex;rn GridView<em>1</em>.DataBind();rn rnrn //翻页事件rn protected void fangye(object sender, GridViewPageEventArgs e)rn rn showdata(e.NewPageIndex);rn rnrn //提示rn protected void tishi(object sender, GridViewRowEventArgs e)rn rn //如果是绑定数据行 ,判断是否是数据行rn if (e.Row.RowType == DataControlRowType.DataRow)rn rn //当鼠标停留时更改背景色rn e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#00A9FF'");rn //当鼠标移开时还原背景色rn e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");rnrn if (e.Row.RowState == DataControlRowState.Normal || e.Row.RowState == DataControlRowState.Alternate)rn rn ((LinkButton)e.Row.Cells[6].Controls[0]).Attributes.Add("onclick", "javascript:return confirm('你确认要删除吗?')");rn rn rnrn //显示编号rn if (e.Row.RowIndex != <em>-</em><em>1</em>)rn rn int id = e.Row.RowIndex + <em>1</em>;rn e.Row.Cells[0].Text = id.To<em>String</em>();rn rn rnrn //删除rn protected void RowDeleting(object sender, GridViewDeleteEventArgs e)rn rn GridViewRow row = GridView<em>1</em>.Rows[e.RowIndex];rnrn DataSet ds = new DataSet();rn string strcn = ConfigurationSettings.AppSettings["Connection<em>String</em>"];rn SqlConnection cn = new SqlConnection(strcn);rn cn.Open();rn string sql = "delete from tjnews where id ='" + int.Parse(GridView<em>1</em>.DataKeys[e.RowIndex].Value.To<em>String</em>()) + "'";rn SqlCommand cm = new SqlCommand(sql, cn);rn cm.ExecuteNonQuery();//执行rn cn.Close();rnrn showdata(0);rn rn[/code]rnrn点击删除的时候会提示Index was out of <em>range</em>,在服务器上会,本地不会,请问是什么原因?
Python2.7:数据清洗的list index out of range问题
```rnfrom csv import readerrnrndata_rdr = reader(open('mn.csv','rb'))rnheader_rdr = reader(open('mn_headers.csv','rb'))rnrndata_rows = [d for d in data_rdr]rnheader_rows = [h for h in header_rdr]rnrnbad_rows = []rnrnfor h in header_rows:rn if h[0] not in data_rows[0]:rn bad_rows.append(h)rnrnfor h in bad_rows:rn header_rows.remove(h)rnrnprint len(header_rows)rnrn Traceback (most recent call last):rn File "/home/sewell<em>-</em>hoo/datafiles/test_list<em>index</em>.py", line <em>1</em>2, in rn if h[0] not in data_rows[0]:rnIndexError: list <em>index</em> out of <em>range</em>rn```rn正在读《python数据<em>处理</em>》一书,这是第7章第2小节的内容:rn<em>处理</em>2个CSV文件,却一直提示List <em>index</em> out of <em>range</em>,实在是想不到哪里错了。rn请忽略图中配图的文件'mn_header_update.csv',两者是一个文件rnrn![图片说明](https://img<em>-</em>ask.csdn.net/upload/20<em>1</em>7<em>1</em><em>1</em>/06/<em>1</em>509974<em>1</em>9<em>1</em>_<em>1</em>07534.png)
麦克风混响效果器 很好的效果下载
麦克风混响效果器,很好的麦克风混响效果,使你的电脑K歌也有混响效果 相关下载链接:[url=//download.csdn.net/download/lsgxlzh/2302831?utm_source=bbsseo]//download.csdn.net/download/lsgxlzh/2302831?utm_source=bbsseo[/url]
GO桌面主题下载
可爱主题,图标可爱,界面清新,GO桌面主题 相关下载链接:[url=//download.csdn.net/download/oweijie123456/5034825?utm_source=bbsseo]//download.csdn.net/download/oweijie123456/5034825?utm_source=bbsseo[/url]
开关电源设计pcb下载
开关电源设计pcb. 相关下载链接:[url=//download.csdn.net/download/u011721811/5963717?utm_source=bbsseo]//download.csdn.net/download/u011721811/5963717?utm_source=bbsseo[/url]
相关热词 c#检测非法字符 c#双屏截图 c#中怎么关闭线程 c# 显示服务器上的图片 api嵌入窗口 c# c# 控制网页 c# encrypt c#微信网页版登录 c# login 居中 c# 考试软件
我们是很有底线的