错误提示:String index out of range: 500? [问题点数:50分,结帖人bomee]

Bbs1
本版专家分:35
结帖率 100%
Bbs6
本版专家分:8241
Blank
黄花 2002年10月 PHP大版内专家分月排行榜第二
Bbs6
本版专家分:6100
Blank
黄花 2002年7月 Java大版内专家分月排行榜第二
Bbs1
本版专家分:35
【Android】Error:Execution failed for task ':app:mergeDebugResources'. > String index out of range: 0
异常提示: Error:Execution failed for task ‘:app:mergeDebugResources’. > String <em>index</em> <em>out</em> of <em>range</em>: 0 错误原因:有一次在进行编译的时候,Android Studio 给我报出了这样一个异常,一开始的我有点摸不着头脑,因为 fail 在 mergeDebugResources ,那么项目很可能出错在
String index out of range: -824264796 不明的原因导致驱动程序造成失败,请回报这个例外。
报错nnnnn2018-08-27 11:26:57.307 ERROR 7188 --- [eate-1016098114] com.alibaba.druid.pool.DruidDataSource : create connection SQLException, url: jdbc:postgresql://192.168.11.21:5432/timescaledb_hdb?cha...
Spring+Hibernate StringIndexOutOfBoundsException String index out解决方法
Spring+Hibernate运行时所出现的异常Caused by java.lang.StringIndexOutOfBoundsException String <em>index</em> <em>out</em>解决方法
Mybatis批量插入index out of range错误(较偏的错误)
批量插入,错误是何,拒绝转载!前言原因改进ndn前言n往往我们看到网上关于各类关于批量插入报这种错误的文章都是传入的集合为null,或者是参数获取不对等等,但是在开发的时候同事遇到了这种类型的错误,我一直以为是网上那些博客那些原因造成的,于是,两只眼睛一直盯着代码看来许久都没有找出什么问题。那是什么问题呢?n原因n是由于项目中用的是sharding-jdbc来进行数据库连接,而sharding-j...
问题收集:使用mybatis generator生成代码报错,StringIndexOutOfBoundsException异常
问题描述:在使用mybatis 生成代码时,报错nnnn报错:java.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: -1 nn问题解决方案:请检查 table 标签下的 domainObjectName属性值首字母是否为大写。修改完成后,问题解决!...
weblogic11g启动时报错
今天在启动weblogic 11g时发现报如下错误:rn rnjava.lang.ClassCastException: com.octet<em>string</em>.vde.backend.BackendRoot cannot be cast to com.octet<em>string</em>.vde.backend.standard.BackendStandardrnat weblogic.ldap.EmbeddedLD...
python使用format出现tuple index out of range报错的可能原因及解决
关于python 使用format格式化输出时出现IndexError: tuple <em>index</em> <em>out</em>of <em>range</em>报错的原因及解决方法rn本人python小白,希望用博客记录下自己犯的错误供自己日后编程和大家编程中参考和防范。rnrn上图是本人变成时出现报错的截图,该报错:tuple <em>index</em> <em>out</em> of <em>range</em>意为元组指数超过范围。在这里format里面的参数和前面的槽是一一对应的,因此...
python 遍历避免list index out of range 超界问题 ----使用句柄遍历
https://blog.csdn.net/qq_27261889/article/details/80422528n
Selenium自动化进行浏览器窗口切换时,报错:“IndexError: list index out of range
使用的窗口切换方法为:       handles = self.driver.window_handlesnself.driver.switch_to.window(handles[1])原因:   点击链接打开一个新窗口的动作还没有完成时,代码已经开始执行切换窗口动作,导致获取不到列表数据。解决办法:   添加等待时间,等待新窗口加载完毕之后,再执行切换窗口动作。  ...
富文本编辑器图片上传失败的BUG解决:IndexError:list index out of range
富文本编辑器图片上传失败的BUG解决n问题原因n我们将通过Django上传的图片保存到了FastDFS中,而保存在FastDFS中的文件名没有后缀名(.png/.jpg/.jif),而ckeditor在处理上传的文件名按照有后缀名来处理,所以会出现bug错误nn解决方法n找到虚拟环境目录中的ckeditor_uploader/views.py文件,如n~/.virtualenvs/meiduo/l...
爬取淘宝评论时出现list index out of range问题
list <em>index</em> <em>out</em> of <em>range</em>  列表越界Traceback (most recent call last):  File &quot;G:/workSpace/Python/TB_Crawler/Crawler_train.py&quot;, line 71, in &amp;lt;module&amp;gt;    print(getCommentsList(ItemURL2))  File &quot;G:/workSp...
python列表删除会出现一个错误 list index out of range
1,这是列表在删除的时候出现的一个问题,目的是为了删除列表中的0元素# _*_ coding:utf-8 _*_n# __author__ = 'dragon'nP = [0, 1, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 1, 0,n 44, 1, 0]nfor i in <em>range</em>(0,len(P)-1):n if(P[i] ==
启动springboot项目报错
n2018-11-07 19:51:11.775[INFO ][background-preinit][o.h.v.i.util.Version:30] HV000001: Hibernate Validator 5.2.4.Finalnn . ____ _ __ _ _n /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \...
String index out of range: 6
[img=https://img-bbs.csdn.net/upload/201305/18/1368875784_483066.png][/img]rn[img=https://img-bbs.csdn.net/upload/201305/18/1368875946_841555.png][/img]rn[img=https://img-bbs.csdn.net/upload/201305/18/1368875959_219033.png][/img]rnrnrn老是说 字符串索引超出范围 到底哪里错了????
String index out of range: -1
String <em>index</em> <em>out</em> of <em>range</em>: -1rnrn是怎么回事啊 rnrn谢谢
奇怪的 String index out of range
int chars = newsform.getContent().length(); //总字符数 intrn int PerPage = 1000; //每页要分的字符数rn int allpage; //总页数rnrn allpage = (chars + PerPage - 1) / (PerPage); //取得总页数rn rn String str[] = new String[allpage];rnrn String news = getStr(newsform.getContent());rn System.<em>out</em>.println(allpage+"页");rn System.<em>out</em>.println(chars+"个字符");rn for (int i = 0; i < allpage; i++) rn rn if (i==allpage-1) rn rn str[i] = news.sub<em>string</em>((i * PerPage));rn System.<em>out</em>.println(str[i].length());rn rn else rn rn str[i] = news.sub<em>string</em>((i * PerPage), ((i + 1) * PerPage));rn System.<em>out</em>.println("第"+i+"次"+str[i].length());rn rnrn rn rn打印出:rn6页rn5191个字符rn第0次1000rn第1次1000rn第2次1000rn第3次1000rnrn这是错误:String <em>index</em> <em>out</em> of <em>range</em>: <em>500</em>0rnrn帮我看下怎么会错的?
String index out of range: 48
String <em>index</em> <em>out</em> of <em>range</em>: 48
Go语言学习八:切片(slice)和范围(range
// Go 语言切片是对数组的抽象。切片的单词来源于可以对其他数组和切片进行片段截取nnn// Go 数组的长度不可改变,在特定场景中这样的集合就不太适用,n// Go中提供了一种灵活,功能强悍的内置类型切片("动态数组"),n// 与数组相比切片的长度是不固定的,可以追加元素,n// 在追加时可能使切片的容量增大。nnnpackage mainnnnimport "fmt"nnnfunc mai
Jsoup的小坑
在使用jsoup的cssSelector获取元素时候,获取到元素在父元素中的位置,要使用e.elementSiblingIndex()获取,这个方法获取到的是正常的元素位置,是元素前后标签一一对应的比如在一个div里&amp;lt;table&amp;gt;&amp;lt;/table&amp;gt;所在的位置是5(从0开始)使用e.elementSiblingIndex()可获得5坑在于e.siblingIndex()这个方法...
faster-rcnn 中训练自己的数据出现的错误
训练过程中错误nnerror 1:assert (boxes[:, 2] >= boxes[:, 0]).all()nnProcess Process-1:nTraceback (most recent call last):nFile "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrapnself
Ubuntu安装过程中出现Out of Range
Ubuntu安装过程中出现了<em>out</em> of <em>range</em>,如何解决。
Faster RCNN 训练自己的检测模型
一、准备自己的训练数据根据pascal VOC 2007的训练数据集基本架构,第一步,当然是要准备自己的训练图片集,本文直接将自己的准备的图片集(.jpg)扔到如下文件夹下:n$(py-faster-rcnn)/data/VOCdevkit2007/VOC2007/JPEGImages第二步,根据上述自己的要训练检测的物体图片集,标注相应的.xml文件(我是自己写了一个简单的矩形框标注工具,生成相应
python3实现《机器学习实战》遇到的问题:range函数
最近在看学习《机器学习实战》这本书。这本书上用的python2的语法,和python3的语法不太一样。由于本人python小白,看了python3的语法,准备自己实现一下代码,遇到了一些问题,故开贴记录一下。rnrnrn书上P82页。书上给出的dataIndex=<em>range</em>(m)然后循环最后一句是rndel(dataIndex[randIndex])rnpython3中这样报错了。rn结果发现原来
StringUtil:字符串处理的工具类
一个字符串处理的工具类(●’◡’●) n包含以下功能:判断应用程序是否安装 n字符拆分成数组 nMD5 加密 n拼接后的字符串 n替换字符串 n判断多个参数是否都为空 n将字符串转换成HTML格式的字符串 n将HTML格式的字符串转换成常规显示的字符串 n获取加密的手机号 n检查手机号 n验证固定电话号码 n检查密码有效 n根据<em>string</em>.xml资源格式化字符串 n验证身份证号码 n将元单位数字转
react native常见的真机调试错误及警告集锦(持续更新中...)
1,undefined不是函数(评估'_this.registerEvents()')nn由于项目使用了最新的RN版本:0.57.0,所引起的:nn首先在项目目录下运行react-native start --reset-cache;nn之后再运行react-native run-android就可以了;nn2、 TaskQueue: Error with task : Invariant Vio...
Bits index out of range
对 Delphi 5 ClientDataSet, Edit操作, Post时报错 Bits <em>index</em> <em>out</em> of <em>range</em>, insert时正常, 不知是何原因?
index Out of Range "">"DBGrid index Out of Range "
Query1->DisableControl();rnfor(int i=0; iAppend();rn Query1->FiledByName("f1")->Value="sss";rn Query1->FiledByName("f2")->Value="sss1";rn Query1->Post();rnrnQuery1->EnableControl();rnrn为什么加上 :rnQuery1->DisableControl();rnQuery1->EnableControl();rn时有时候会出现"DBGrid <em>index</em> Out of Range " 错误!rn
String index out of range: -2问题
今天突然遇到这个问题。String <em>index</em> <em>out</em> of <em>range</em>: -2不知道为什么?请高手指点迷津。rn[code=Java]java.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: -2rn at java.lang.String.sub<em>string</em>(String.java:1444)rn at jsp_servlet._fams.__tb_assetscard_car_doadd._jspService(__tb_assetscard_car_doadd.java:203)rn at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)rn at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)rn at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)rn at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)rn at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7047)rn at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)rn at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)rn at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)rn at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)rn at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)rn at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)[/code]
String index out of range: -1 异常,急需处理
nnnn  
java.lang.StringIndexOutOfBoundsException: String index out of range: 9 at java
java.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: 9 rnat java.lang.String.sub<em>string</em>(String.java:1765) rnat com.sq.entity.builder.Utilities.getStrLen(Utilities.java:1462) 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:717) 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:717) 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:191) rnat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) rnat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) rnat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) rnat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) rnat org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) rnat org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) rnat org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) rnat java.lang.Thread.run(Thread.java:595) rnrnrn这是一个发布的别人的网站,可是里面有很多地方都报的这同一个错,怀疑不是单纯的下标越界问题,不晓得原因究竟出在哪里?希望有遇到类似情况 的高手解答一下迷津,谢了!!!
java.lang.StringIndexOutOfBoundsException: String index out of range: -1错误
[img=https://img-bbs.csdn.net/upload/201704/14/1492166177_246376.png][/img][img=https://img-bbs.csdn.net/upload/201704/14/1492166190_367039.png][/img]rnrn //向服务器获取根目录rn public static String getRootList() throws Exceptionrn String json = "\"type\":\"getRootList\"";rn <em>out</em>put.write(json.getBytes());rn <em>out</em>put.flush();rn byte[] b = new byte[1024];rn int len = input.read(b);rn json = new String(b,0,len);//字符串进行转化rnrn Config.ROOT_LIST_JSON_STR = json;rn return json; rn rn[img=https://img-bbs.csdn.net/upload/201704/14/1492166266_975276.png][/img]rntry rn String json_str = Config.service.getRootList();rn System.<em>out</em>.println(json_str);rn JSONObject json = JSONObject.fromObject(json_str);//对json的解析rn rn JSONArray jsonArray_mulu = json.getJSONArray("mulu");rn JSONArray jsonArray_files = json.getJSONArray("files");rn rn this.removeAll();rn rn int count = jsonArray_mulu.size()+jsonArray_files.size();rn rn for (int i = 0; i < jsonArray_mulu.size(); i++) rn JSONObject mulu = jsonArray_mulu.getJSONObject(i);rn rn this.add(new FileJPanel(mulu.getString("rdid"), mulu.getString("did"), "DIR", mulu.getString("dname")));rn rn rn for (int i = 0; i < jsonArray_files.size(); i++) rn JSONObject file = jsonArray_files.getJSONObject(i);rn this.add(new FileJPanel(file.getString("did"), file.getString("fid"), "FILE", file.getString("fname")));rn rn rn rn this.setPreferredSize(new Dimension(508,(count/5+(count%5==0?0:1))*135));rn catch (Exception e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn javax.swing.JOptionPane.showMessageDialog(this.getParent(), "网络异常,请稍后再试");rn rn相关的代码贴出来了,但不是很理解这个数组怎么就越界了。也不知道怎么去修改
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
HTTP Status <em>500</em> - rnrn--------------------------------------------------------------------------------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:314)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:74rnrn71: 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:314)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:133)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:314)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.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: -1rn java.lang.String.sub<em>string</em>(String.java:1768)rn org.apache.jsp.product.newproductinfo_jsp._jspService(org.apache.jsp.product.newproductinfo_jsp:147)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:314)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:133)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:314)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.15 logs.rnrnrn--------------------------------------------------------------------------------rnrnApache Tomcat/5.5.15
index out of range exception??
question:rn [color=#0000FF] rn <em>index</em> <em>out</em> of <em>range</em> exception??[/color]rnrnerror code :rnrn [color=#FF00FF] if (!Convert.IsDBNull(reader["Name"]))rn username = reader["Name"].ToString();[/color]rnrnrnsources code:rnrn public bool LoginUser(<em>string</em> username,<em>string</em> pwd)rn rn rn bool exists = false;rn SqlParameter[] parms = new SqlParameter[2];rn parms[0] = new SqlParameter("@name", SqlDbType.NVarChar, 100);rn parms[1] = new SqlParameter("@password", SqlDbType.NVarChar, 100);rn parms[0].Value = username;rn parms[1].Value = pwd;rn SqlDataReader reader = DbTools.ExecuteReader("LoginUserProce", parms);rnrn if (reader.Read())rn rn exists = true;rn [color=#0000FF] if (!Convert.IsDBNull(reader["name"]))rn username = reader["name"].ToString();[/color]rn if (!Convert.IsDBNull(reader["password"]))rn pwd = reader["password"].ToString();rn rn rn reader.Close();rn return exists;rnrn rnrnrn
grid index out of range
beginrn dmData.adoQCode.open;rn dmData.adoQCode.Append;rn dmData.adoQCode.FieldByName('Type').AsString := cbbType.Text;rn dmData.adoQCode.FieldByName('Value').AsString := edtValue.Text;rn dmData.adoQCode.FieldByName('Mem').AsString := edtMem.Text;rn dmdata.adoQCode.Post;rn end;rn我用的是DBgrid和Access库,在添加一条记录时报出grid <em>index</em> <em>out</em> of <em>range</em> 的错误,请各位知道的加以指点
root cause java.lang.StringIndexOutOfBoundsException: String index out of range
HTTP Status <em>500</em> -rnrntype Exception reportrnrnmessagernrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexceptionrnrnorg.apache.jasper.JasperException: java.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: -1rn 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:313)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnroot causernrnjava.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: -1rn java.lang.String.sub<em>string</em>(String.java:1932)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:717)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnnote The full stack trace of the root cause is available in the Apache Tomcat/6.0.33 logs.
string index out of range字符串怎么越界了?
打印出来s.encode('hex')是 0300 但是打印s[1]却报下面错误?rn<em>string</em> <em>index</em> <em>out</em> of <em>range</em>
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
09:57:40,051 ERROR Dispatcher:38 - Exception occurred during processing request: String <em>index</em> <em>out</em> of <em>range</em>: 0rnjava.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: 0rn at java.lang.String.charAt(String.java:658)rn at org.hibernate.type.CharacterType.get(CharacterType.java:52)rn at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:186)rn at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:175)rn at org.hibernate.type.AbstractType.hydrate(AbstractType.java:105)rn at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2267)rn at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1443)rn at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1371)rn at org.hibernate.loader.Loader.getRow(Loader.java:1271)rn at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:619)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:1953)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:152)rn at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1080)rn at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1028)rn at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:623)rn at org.hibernate.type.EntityType.resolve(EntityType.java:431)rn at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:140)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:2192)rn at org.hibernate.loader.Loader.list(Loader.java:2187)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:196)rn at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1258)rn at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)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:183)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)rn at com.sun.proxy.$Proxy18.getfindById(Unknown Source)rn at com.bjpowernode.drp.base.action.ClientAction.getfindById(ClientAction.java:31)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:167)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:138)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:191)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:91)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:100)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)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.I18nInterceptor.intercept(I18nInterceptor.java:161)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rnrnrnrn[color=#FF0000]rn以上这些是异常信息,我确定我是执行这条语句出错:rnhibernateTemplate.get(Client.class, id);rn我也确定id有值 比如10001是数值型int,rn百思不得其解,赐教!rn[/color]
求助:String index out of range: 0 !!!
[img=https://img-bbs.csdn.net/upload/201606/27/1467029138_584565.png][/img]rn当程序在执行这条语句时,报String <em>index</em> <em>out</em> of <em>range</em>: 0!!异常 但是自己也没有使用过数组之类的容器,求各位大大帮助,已经纠结两天了!
java.lang.StringIndexOutOfBoundsException: String index out of range: -6
在解析数据库中一个字段的数据的时候总是报数组越界这个错误,具体情况:rn数据库中有4W多条数据,我要比较a字段和b字段中是否有相同部分,用到了字符串的sub<em>string</em>()方法rn我测试过多次,但每次报错的数据都不一样,都报数组越界的错。rnrnIR_SID IR_SRCNAME rn----------- -------------------------rn5963 JB 3540-1983 ; rnrnrnIR_SID IR_SRCNAME rn----------- -------------------------rn7216 JB/T 8648.2-1997 ; rnrnIR_SRCNAME的数据是我要用sub<em>string</em>()方法处理的数据,运行一次会报处理JB 3540-1983出现数组越界的错,再重新运行一次会报处理JB/T 8648.2-1997出现数组越界的错,运行多少次就会出现多少次不同的数据报错,并且都是数组越界,我的问题是[color=#FF0000]如果真的是某个数据或者某些数据在用sub<em>string</em>()处理的时候有错的话应该是一直报错,为什么运行一次就报不同的数据有错呢?[/color]rnrn下面是具体代码:rn[code=Java]rnconn = DBConnectionManager.getInstance().getConnection();rnString 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].toString());rnurltitle = ((String) obj[1]).trim();rnif(obj[2] == null||"".equals(((String) obj[2]).trim()))rn srcnames = "";rnelsern srcnames = ((String) obj[2]).trim();rnrnString titlenum = null;rnString newcol = "";rnif(!urltitle.contains("-"))rn urltitle = urltitle+"-";rnrn titlenum = (urltitle.sub<em>string</em>(urltitle.lastIndexOf(" ")+1, urltitle.lastIndexOf("-"))).trim();rn if(srcnames!=null)rn String[] 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("-"))rn srcname[j] = srcname[j].trim()+"-";rn rn rn String srcnum = (srcname[j].trim().sub<em>string</em>(srcname[j].trim().lastIndexOf(" ")+1, srcname[j].trim().lastIndexOf("-"))).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.toString(), null);rnSystem.<em>out</em>.println("执行完毕!");rn[/code]
String index out of 4解决方法
String <em>index</em> <em>out</em> of 4解决方法
String index out of range: -91 怎么解决?
String files = "[2010-07-19 08:20:51] Uin=1072, UserName=林立, Addr=XXXX:1047, Action=login, Mode=local, Result=0(success)\n"rn+ "[2010-07-19 22:55:08] Uin=1017, UserName=伟文, Addr=XXXX:1070, Action=log<em>out</em>, Mode=local";rn rn String loginTime="";rn int uin=0;rn String userName="";rn String addr="";rn String action="";rn String mode="";rn String result="";rn String[] lines = files.split("\n");rn for(String line:lines)rn rn vo = new LogVO();rnrn int <em>index</em>1 = line.<em>index</em>Of("[");rn int <em>index</em>2 = line.<em>index</em>Of("]");rn loginTime = line.sub<em>string</em>(<em>index</em>1+1, <em>index</em>2);rn rn int <em>index</em>3 = line.<em>index</em>Of("Uin=");rn int <em>index</em>4 = line.<em>index</em>Of(",", <em>index</em>3);rn uin = Integer.parseInt(line.sub<em>string</em>(<em>index</em>3+4, <em>index</em>4));rnrn int <em>index</em>5 = line.<em>index</em>Of("UserName=");rn int <em>index</em>6 = line.<em>index</em>Of(",", <em>index</em>5);rn userName = line.sub<em>string</em>(<em>index</em>5+9, <em>index</em>6);rnrn int <em>index</em>7 = line.<em>index</em>Of("Addr=");rn int <em>index</em>8 = line.<em>index</em>Of(",", <em>index</em>7);rn addr = line.sub<em>string</em>(<em>index</em>7+5, <em>index</em>8);rnrn int <em>index</em>9 = line.<em>index</em>Of("Action=");rn int <em>index</em>10 = line.<em>index</em>Of(",", <em>index</em>9);rn action = line.sub<em>string</em>(<em>index</em>9+7, <em>index</em>10);rnrn int <em>index</em>11 = line.<em>index</em>Of("Mode=");rn int <em>index</em>12 = line.<em>index</em>Of(",", <em>index</em>11);rn mode = line.sub<em>string</em>(<em>index</em>11+5, <em>index</em>12);//到了这里就说下标越界了rn if(line.contains("Result="))rn rn int <em>index</em>13 = line.<em>index</em>Of("Result=");rn int <em>index</em>14 = line.<em>index</em>Of("\n", <em>index</em>13);rn result = line.sub<em>string</em>(<em>index</em>13+7, 8);rn rn rn vo.setLoginTime(loginTime);rn vo.setUin(uin);rn vo.setUserName(userName);rn vo.setAddr(addr);rn vo.setAction(action);rn vo.setMode(mode);rn vo.setResult(result);rn list.add(vo);rn rnrn我现在是从日志里面解析出各个字段信息,但是到mode = line.sub<em>string</em>(<em>index</em>11+5, <em>index</em>12);//这一行就报错:String <em>index</em> <em>out</em> of <em>range</em>: -91,下面一个result也是越界,这个要怎么改呢?rn
java.lang.StringIndexOutOfBoundsException:String index out of range:-1
程序如下:rnrn包上述错误,没见过怎么回事?
java.lang.StringIndexOutOfBoundsException: String index out of range: 116
at java.lang.String.checkBounds(String.java:402)rnat java.lang.String.(String.java:443)rnat jxl.biff.StringHelper.getString(StringHelper.java:164)rnat jxl.read.biff.WriteAccessRecord.(WriteAccessRecord.java:56)rnat jxl.read.biff.WorkbookParser.parse(WorkbookParser.java:821)rnat jxl.Workbook.getWorkbook(Workbook.java:237)rnat jxl.Workbook.getWorkbook(Workbook.java:198)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:221)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:221)rnat com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)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:221)rnat com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)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:221)rnat com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)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:221)rnat com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)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:221)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:221)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:221)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:221)rnat com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)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:221)rnat org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107)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:221)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:221)rnat com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)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:221)rnat com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)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:221) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121) 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:221)rnat org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170)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:221)rnat com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123)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:221)rnat com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn
String index out of range: -6 的错误
初次使用hibernate,然后将一个页面中的数据插入到数据库中时,就阴魂不散的发生了这个错误,我插入的值只是一位:“1”,却总是报这个错,有谁也碰到过这个问题吗?
mybatis genertor 实践及遇到的问题
参考:nSpring boot Mybatis 整合(完整版)——没有坑点,一次成功nhttps://blog.csdn.net/Winter_chen001/article/details/77249029nhttps://blog.csdn.net/pucao_cug/article/details/64499355nhttps://blog.csdn.net/Winter_chen001/a...
Redis服务-linux下的配置
关系数据库管理系统-RDMS-数据按照预先设置的组织结构,存储在NoSQL(NoSQL=Not Only SQL)-非关系型数据库-不需要预先定义数据存储结构-表的每条记录都可以有不同的类型和结构主流软件-Redis-MongoDB-Memcached-CouchDB-Neo4j-FlockDB部署Redis服务--Remote Dictionary Server(远程字典服务器)--是一款高性能...
tomcat项目迁移到weblogic过程中遇到的问题(持续更新)
最近因为实在受不了tomcat在myeclipse中的表现,于是转到weblogic上,没想到第一个项目就没有部署成功。可能是我对tomcat的了解不够深入。n1.第一个问题就是 查看日志发现Caused By: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy是这个异常。
遇到的 string类 +PAT遇到的各种问题
以后遇到什么 就再加上 nns.append(a,'0');   在字符串s的末尾 加上a个'0'nns.insert(0,a,'0');  在字符串下标为0的地方 加上长度为a 的字符'0'nn_____find的用法nnn#include &amp;lt;iostream&amp;gt;nusing namespace std;nint main(){n <em>string</em> a=&quot;abcde&quot;,b=&quot;ab&quot;;n i...
URLEncoder和URLDecoder实现转码和解码
在Java开发中,URL跳转经常遇到中文乱码问题。实际上,如果细心的话,我们会发现在访问网页时经常会在URL中看到一些16进制格式的字符串,如:http://xxx.com/s?w=%e7%bcn这其实就是用到Java.net包下的URLEncoder和URLDecoder这两个类来对URL参数实现转码和解码。n1、URLDecoder(解码)n源码上对此解释是: nUtility cla
Python学习-机器学习实战-ch04 Bayes
毕业论文写不下去,就逃避来学这个n万事开头难,要勇敢迈出第一步n加油!n========================================================================================n贝叶斯的原理不赘述啦,网上还是有很多资料的nnn创建一个数据集,书中是以文档分类的例子来讲ndef loadDataSet():
numpy基础
numpy基础nn1、数组nn1)用np.ndarray类的对象表示n维数组nnn实际数据:数组中元素n元数据:描述数组中的元素n将实际数据与元数据分开存放,一方面提高了内存空间的使用效率,另一方面减少对实际数据的访问频率,提高性能nnn2)Numpy数组是同质数组,即所有元素的数据类型必须相同,类似c语言的数组n3)Numpy数组的下标从0开始,最后一个元素的下标为数组长度减1n4)np.nda...
将int字段改为decimal类型时出现1264 Out of range value的问题分析和处理
有开发同事在验证环境对某个表将int字段改成decimal(10,4)后,提示 1264 Out of <em>range</em> value报错,咨询dba这个为什么会报错,对数据有什么影响?n我收到这问题后,第一反应就是由于字段类型转换,长度不够发生了数据溢出。n于是,下面对模拟该问题进行测试:n1.建测试表nCREATE TABLE `zeng` (n  `_id` int(11) NOT NUL
SpringMVC学习笔记(三)-----Controller拦截3种类型的URL
ControllerController负责处理URL和数据处理以及页面的返回。第一种—–传统的URL // 传统样式n @RequestMapping(value = "/<em>index</em>", method = RequestMethod.GET)n // 本方法将处理/book/<em>index</em>?bookId=123n public String viewBook(@RequestParam("bo
Python 进阶(二)
9. Picklingn可将整个数据结构中的内容存入文件以便程序下次运行时能够读取。n将一个复杂的列表结构存储到文件中:n&amp;amp;amp;gt;&amp;amp;amp;gt;&amp;amp;amp;gt; import picklen&amp;amp;amp;gt;&amp;amp;amp;gt;&amp;amp;amp;gt; mylist = [23, 'abc', [44, 12]]n&amp;amp;amp;gt;&amp;amp;amp;gt;&amp;amp;amp;gt; f =
python-excel的模块xlrd和xlwt用法及注意事项整理
本文为整理性文章,将会不定期更新,一旦发现bug就会更新。n另外一句话总结一下:这三个模块虽然简单易用,但是bug太多,功能太少,无法吐槽,远远没有perl的excel模块好用。n n目录:n一、主要方法列表n二、已知BUG列表n三、官方文档下载
string subscript out of range
我使用rntemp.erase(temp.end()-1);rn后编译时没错,运行时出现RT错误!高手帮忙啊!
String out of range : 1303128
engineurl:http://127.0.0.12:8888/transrnparameterKey:config=BR&Code=010&x1=116.810918&y1=39.912719&x2=121.6018793&y2=38.8028643&r<em>out</em>eType=0&language=cn&ver=2.0rnjava.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: 1303128rn at java.lang.String.checkBounds(String.java:401)rn at java.lang.String.(String.java:442)rn at com.mapabc.sis.server.core.service.impl.BusR<em>out</em>eServiceImpl.byteToString(BusR<em>out</em>eServiceImpl.java:313)rn at com.mapabc.sis.server.core.service.impl.BusR<em>out</em>eServiceImpl.format2NewBusR<em>out</em>eBeans(BusR<em>out</em>eServiceImpl.java:183)rn at com.mapabc.sis.server.core.service.impl.BusR<em>out</em>eServiceImpl.invokeService(BusR<em>out</em>eServiceImpl.java:72)rn at com.mapabc.sis.server.core.service.CoreServices.processRequest(CoreServices.java:192)rn at com.mapabc.sis.server.core.service.CoreServices.doGet(CoreServices.java:343)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)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:196)rn at com.mapabc.sis.server.core.access.LBSServer.doGet(LBSServer.java:93)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)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:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.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.BusR<em>out</em>eCoords.invokeCoords(BusR<em>out</em>eCoords.java:42)rn at com.mapabc.sis.server.core.service.CoreServices.processRequest(CoreServices.java:211)rn at com.mapabc.sis.server.core.service.CoreServices.doGet(CoreServices.java:343)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)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:196)rn at com.mapabc.sis.server.core.access.LBSServer.doGet(LBSServer.java:93)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)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:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.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出现如下提示,但是服务并没发生中断之类的错误。这个问题是什么原因导致呢。该如何解决呢
Row index out of range问题
public class Table1 extends JFramern String rid[] = new String[100];rn int count = 0;rn /*rn * public static void main(String a[]) new Table1(); 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 - x / 2), (int) (yy / 2 - y / 2));rn rn public Table1() rn JPanel zuida = new JPanel(new BorderLay<em>out</em>(0, 10));rn JPanel jp1 = fangzi();rn JPanel jp2 = dingdan();rn jp2.setBorder(BorderFactory.createTitledBorder("订单信息"));rn JTabbedPane tp = new JTabbedPane();rn tp.addTab("房间预定", jp1);rn tp.addTab("订单信息", jp2);rn // zuida.add(jp1);rn zuida.add("North", tp);rn JFrame frame = new JFrame("酒店");rn frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);rn //zuida.setBackground(new Color(102,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.<em>out</em>.println("123");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 FlowLay<em>out</em>(FlowLay<em>out</em>.CENTER, 30, 10));rn JPanel panel3 = new JPanel(new GridLay<em>out</em>(1, 10));rn JPanel panel4 = new JPanel(new BorderLay<em>out</em>(0, 10));rn panel.setPreferredSize(new Dimension(600, 400));rn panel.setLay<em>out</em>(new BorderLay<em>out</em>());rn JButton b1 = new JButton("预订");rn JButton b2 = new JButton("加至购物车");rn JButton b3 = new JButton("预定多个");rn JButton b4 = new JButton("生成订单");rn panel2.add(b1);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 b1.addActionListener(bListener);rn b2.addActionListener(bListener);rn b3.addActionListener(bListener);rn b4.addActionListener(bListener);rnrn panel.add("Center", pane);rn panel.add("S<em>out</em>h", 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 jp10 = new JPanel(new BorderLay<em>out</em>());rn jp10.add("Center", pane);rn JButton b1 = new JButton("确定");rn JButton b2 = new JButton("刷新");rn jp10.add("S<em>out</em>h", b1);rn jp10.add("North",b2);rn ButtonListener bListener1 = new ButtonListener(dingdan);rn b1.addActionListener(bListener1);rn b2.addActionListener(bListener1);rn return jp10;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:1433;DataBaseName=Hotel", "sa", "123");rn PreparedStatement statement = con.prepareStatement("Select * from 订单 where Userid =? ");rn statement.setString(1, new MainClass().getname());rn ResultSet rs = statement.executeQuery();rn while (rs.next()) rn Vector hangv = new Vector();rn hangv.add(Integer.parseInt(rs.getString(1)));rn hangv.add(rs.getString(2)); rn hangv.add((rs.getString(3))); rn hangv.add((rs.getString(4))); rn hangv.add((rs.getInt(5))); rn hangv.add((rs.getString(6))); rn hangv.add((rs.getInt(7)));rn hangV.add(hangv);rn rn catch (Exception e) rn System.<em>out</em>.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.doLay<em>out</em>();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:1433;DataBaseName=Hotel", "sa", "123");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.getString("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.getString("raddress"));rn hangv.add(row[x][y]);rn y++;rn row[x][y] = (rs.getString("rtype"));rn hangv.add(row[x][y]);rn y++;rn row[x][y] = (rs.getString("rstate"));rn hangv.add(row[x][y]);rn x++;rn y = 0;rn hangV.add(hangv);rn rn catch (Exception e) rn System.<em>out</em>.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.doLay<em>out</em>();rn jiu.setBackground(Color.LIGHT_GRAY);rnrn return jiu;rn rnrnrnrnrnErrorjava.lang.IllegalArgumentException: Row <em>index</em> <em>out</em> of <em>range</em>rn实在不知道怎么修改rn
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('.')[1]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[1])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 21, in rn fun(r'C:\wmpub')rn File "C:\Documents and Settings\Administrator\桌面\test.py", line 14, in funrn print(newsp[1])rnIndexError: list <em>index</em> <em>out</em> of <em>range</em>rn>>>
Parameter index out of range 谢谢!
谢谢大家!帮我看看这个错误怎么回事,谢谢!!rnrnjava.sql.SQLException: Parameter <em>index</em> <em>out</em> of <em>range</em> (1 > number of parameters, which is 0).rn at com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:2493)rn at com.mysql.jdbc.PreparedStatement.setString(PreparedStatement.java:3213)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:421)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)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:173)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.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
std::out_of_range 抛出抛出异常
[code=cpp]n// <em>out</em>_of_<em>range</em> examplen #include // std::cerrn #include // std::<em>out</em>_of_<em>range</em>n #include // std::vectorn n int main (void) {n std::vectorint> myvector(
数据处理 sklearn
contour和contourf都是画三维等高线图的,不同点在于contourf会对等高线间的区域进行填充nimport numpy as npnimport matplotlib.pyplot as pltnfrom matplotlib.colors import ListedColormapnx=np.array([1,2])ny=np.array([1,2])nz=np.array([[...
《机器学习实战》-chapter4-朴素贝叶斯
这一章主要是介绍了朴素贝叶斯的算法思想以及如何构造一个简单的朴素贝叶斯网络用来过滤掉垃圾邮件。nn首先在朴素贝叶斯中有两个非常重要的假设:nn假设所有的特征都是独立的n 假设所有的特征都是同等重要的n具体的细节大家可以在书上找到,下面说一下这一章需要改的地方(由于Python版本不同而导致的错误,我是在python3.6下进行实验的):nnemai/ham/23.txt需要把第二行第一个单词后面的...
Word Count(结对项目)
bithlh n结对项目 nhttps://github.com/John-zjm/Word-Countnn一、PSP表格nn n二、性能分析nn1 因为.c文件有多种格式,为了提高程序的性能和可用性,我们花了半天时间对程序进行了改进,使它能够支持多种格式,提高了程序的实用性。并且我们添加了界面,使程序功能更加完善。nn2 性能分析图nnnn3.消耗最大函数 nnnndef file_name(f...
《机器学习实战》朴素贝叶斯
机器学习实战的朴素贝叶斯一章中的源文件老是提示rnIndexError: <em>range</em> object <em>index</em> <em>out</em> of <em>range</em>rn看源码里怎么都不会溢出啊,除非minLen为0;所以看了下测试集中的两个链接,第一个链接打开后是正常的,第二个打不开了,所以问题就出在这里了,minLen确实等于0了,怎么修改呢?只好把挂掉的链接换一个新的,我换的是参考资料:rnhttp://www.cnbl
python 异常处理 (转)
n一)捕获异常rn格式一:rntry:rn    &amp;lt;语句&amp;gt;rnexcept &amp;lt;异常1&amp;gt;:rn    &amp;lt;语句&amp;gt;rnexcept &amp;lt;异常2&amp;gt;:rn    &amp;lt;语句&amp;gt;rnelse:           如果没有异常,则执行else块中的语句rn    &amp;lt;语句&amp;gt;rn格式二:rntry:rn    &amp;lt;语句&amp;gt;rnfinally:
vector subscript out of range错误提示
[code=C/C++]rnvoid CUtilityApp::InsertFlagToExcelData(CString DataFlag,map>> &mapExcelData)rnrn for (map>>::iterator itr_map=mapExcelData.begin();itr_map!=mapExcelData.end();itr_map++)rn rn for (vector>::iterator itr_vec=itr_map->second.begin();itr_vec!=itr_map->second.end();itr_vec++)rn rn if (itr_vec == itr_map->second.begin())rn rn itr_vec->insert(itr_vec->begin(),_T("数据标志"));rn elsern rn itr_vec->insert(itr_vec->begin(),DataFlag);rn rn rn rn[/code]
使用hadoop编写mapreduce程序的注意点
rn编程时需要注意:rn1、实例化job后,不要再使用原来的configuration,而需通过job.getCongfigure()来进行参数的配置rn rnpublic static Job createSubmittableJob(Configuration conf, String[] args) rn throws IOException {rn String tableName = ...
Maven构建项目速度太慢的解决办法,以及报错Retrieving archetypes:' has encountered a problem
如果报错信息如下:nRetrieving archetypes:’ has encountered a problemnAn internal error occurred during:"Retrieving archetypesndetails:nAn internal error occurred during: “Retrieving archetypes:”.n看了网上的答案,发现好多坑...
python-格式化输出-format
format_str = "{0:{3}^10}\t{1:^10}\t{2:^10}"   # 3表示format中第三个字符串chr(12288),中文空格n    print(format_str.format("学校","省份","num",chr(12288)))
python之错误解决(持续更新……)
1.UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xbb in position 1057: invalid start bytern解决:rn把data = data.decode(encoding)改成data = data.decode(“ISO-8859-1”)rn2.如果出现乱码,搜素页面源代码,可以看到页面编码为GBK,修改enco...
CP2K运行时显示Index to radix array not found 错误的解决方法
有时体系过大,cp2k运行时显示Index to radix array not found错误,此时在脚本的&GLOBAL中加上:rnEXTENDED_FFT_LENGTHS Trn即可
对于windows平台下的vs2010下vector数组提示“vector subscript out of range”很头疼
对于下面的部分代码,在vs2010的windows平台下提示数组越界(编译通过,执行exe提示)但是在深度linux下的codeblock正常。 //第一种形式n /*Vector <em>out</em>line(filterContours.size()+1);n for(size_t i = 0; i < filterContours.size(); i
react native 0.49.5 报错/注意事项集锦(持续更新)
n n n 欢迎大家 ❤️ 收藏,遇到问题在此页面 command + F 说不定你遇到的问题已经有解决方案了,如果有问题可以在下方评论,嘿嘿,(。◕ˇoˇ◕。)nnnnnnimage.pngnnnreact native cached bundlesnn出现原因:n(。◕ˇ_ˇ◕。)n多个react native应用来回切换使用 Debug JS Remotely远...
7天掌握NIO和SOCKET,第四天,通道打开文件的StandardOpenOption的枚举常量的使用方法,判断通道是否打开
import java.io.File;nimport java.io.RandomAccessFile;nimport java.nio.ByteBuffer;nimport java.nio.CharBuffer;nimport java.nio.channels.FileChannel;nimport java.nio.charset.Charset;nimport java.nio.fi...
Python错误问题2
IndexError: list assignment <em>index</em> <em>out</em> of <em>range</em>nn1.错误:生成一个空的list列表a = [],给a赋值的时候a[0] = 1时出现上述的错误nn&amp;gt;&amp;gt;&amp;gt; a = []n&amp;gt;&amp;gt;&amp;gt; a[0] = 1nTraceback (most recent call last):n File &quot;&amp;lt;input&amp;gt;&quot;, li...
jupyter使用笔记
countByValue时出现错误(list <em>index</em> <em>out</em> of <em>range</em>),原因是出现数组越界,有些用户对应的行数据小于44。n解决方法:过滤那些行数据量小于44的用户nnn
mycat1.6 通过navicat导入数据的时候报错的问题
navicat连接mycat 8066端口执行时,如果执行的sql有类似如下单行注释时,会导致导入失败。nnnSET FOREIGN_KEY_CHECKS=0;nn-- ----------------------------n-- Table structure for testn-- ----------------------------nDROP TABLE IF EXISTS `test...
faster rcnn源码解读(五)之layer(网络里的input-data)
faster rcnn用python版本的https://github.com/rbgirshick/py-faster-rcnnnlayer源码地址:https://github.com/rbgirshick/py-faster-rcnn/blob/master/lib/roi_data_layer/layer.pyn源码:n# ------------------------------
机器学习实践 学习笔记3 decision trees
决策树(decision trees)nnn工作原理:n决策树属于监督类型的算法,同样,我们有数据集,知道每一条数据的分类。然后我们按照某种规则,选取数据集上的特征作为分割点,把数据集进行划分。循环重复以上动作,直至所有数据集各自的分类都是唯一的,或者所有特征已经被选择无法再进行划分。使用何种规则进行特征的选取下文将会叙述。nnn优点:计算复杂度不高,输出结果易于理解,对中间值的缺失
CART树回归
基于树的回归算法是一类基于局部的回归算法,通过将数据集切分成多份,在每一份数据中单独建模。与局部加权线性回归不同的是,基于树回归的算法是一种基于参数学习的算法,利用训练数据训练完模型后,参数一定确定,无需再改变。分类回归树(Classification And Regression Tree,CART)算法是使用比较多的一种树模型,CART算法既可以解决分类问题也可以解决回归问题。前面的博客随机森林
17个新手常见的Python运行时错误,你都注意到了吗?
当初学 Python 时,想要弄懂 Python 的错误信息的含义可能有点复杂。这里列出了常见的的一些让你程序 crash 的运行时错误。1)忘记在 if , elif , else , for , while , class ,def 声明末尾添加 :(导致 “SyntaxError :invalid syntax”)该错误将发生在类似如下代码中:2)使用 = 而不是 ==(导致“SyntaxE...
fastJson中一些问题总结
1. json字符串中,“{”表示 的是对象,“]"表示的是数组, 例如:{"nodeId":1,"parentId":0,"descript":"AA","children":[{"nodeId":2,"parentId":1,"descript":"BB","children":null},nn{"nodeId":3,"parentId":1,"descript":"CC","childr
数据库最后一个字段Null导致mybatis抛出异常ArrayIndexOutOfBoundsException
数据库最后一个字段Null导致mybatis抛出异常ArrayIndexOutOfBoundsExceptionmybatis抛出异常ArrayIndexOutOfBoundsException项目框架出错原因解决方法nmybatis抛出异常ArrayIndexOutOfBoundsExceptionn项目框架nSpring boot1.5.9 + mybatis3 + mysql-conecto...
目标检测:Faster rcnn 安装、训练、测试
说明:这个是Faster RCNN刚出来时候的博文记录,最新的可能会有更变,如有问题,请大家查阅官网链接。nnnn先上个检测效果:nn(1)图片人脸检测+关键点 nnnn(2)摄像头实时人脸+关键点nnnn**********************************************************...
fast-rcnn训练实战
这一周训练了一个fast-rcnn网络,趁着还没有忘记先记一笔。n关于图片检测detection这一类问题,随着CNN的流行出现了许多新的方法与系统。其中RCNN就是比较出名的一个。Rcnn的论文在此nhttp://www.cs.berkeley.edu/~rbg/papers/r-cnn-cvpr.pdfnncaffe里也实现了rcnn具体的demonnhttp://nbviewer
jfinal 分页时,sql动态传值出错
错误:Parameter <em>index</em> <em>out</em> of <em>range</em> (1 &amp;gt; number of parameters, which is 0)解决方法:此错误是指传入的参数和你要接受的参数不匹配。参数 传多了一个,没有接受参数,或者说 没有占位符 ,你给1个参数错误可能:sql拼写错误导致没识别到接受参数等,或者sql没有写接受参数,又或者你接受的参数位置的单引号周围出现错误。又或者我遇到的这...
go开发遇到的坑--range
先看下下面的代码package mainimport "fmt"ntype coder struct {n Name <em>string</em>n Age intn}nfunc main() {n m := make(map[<em>string</em>]*coder)n coders := []coder{n {Name: "han", Age: 24},n {Name:
求助:string subscript out of range
新手求助!rn//Main.cpprn#include rn#include rn#include rn#include rnint main()rnrn using namespace std;rn ofstream <em>out</em>File;rn <em>out</em>File.open("可修复装备.txt");rn ifstream inFile;rn inFile.open("Commodity.ini");rn if (!inFile.is_open())rn rn c<em>out</em> <<
Python语法-1-变量、输出、List列表、tuple元组、条件判断和循环等重要基础知识
针对Openmv3上的Python应用(摘录带修改)输出1、用print()在括号中加上字符串,就可以向屏幕上输出指定的文字。比如输出'hello, world',用代码实现如下: print('hello, world')nhello, worldnprint()函数也可以接受多个字符串,用逗号“,”隔开,就可以连成一串输出: print('The quick brown fox', 'j...
string subscript out of range! 急!!!!
rn编译程序出现的Assert问题!rn弹出一个Visual C++ Debug Library错语!rnrn错误点:rnrnQueryInterface()查找接口时,请问这程情况一般是什么问题!?
String index out of range: -2 是什么意思呢?
String <em>index</em> <em>out</em> of <em>range</em>: -2 是什么意思呢?rn-1是越界,-2呢?rn请高手解释一下啊!
struts2+dtree树形结构下载
很容易上手的struts2的树形结构,已经有struts2包,直接部署到tomcat目录就可以是使用,地址为:http://localhost:8080/DtreeDemo/,端口改为自己的端口。更详解的解说,请进我的博客:http://blog.csdn.net/baozhiyao234/archive/2010/06/17/5676361.aspx 相关下载链接:[url=//download.csdn.net/download/baozhiyao234/2463006?utm_source=bbsseo]//download.csdn.net/download/baozhiyao234/2463006?utm_source=bbsseo[/url]
基于java的数独游戏下载
这是一个J2ME的数独游戏,里面有详细的代码和生成的jar程序,让你学会制作这个小游戏。这个游戏,相信朋友们都知道的,以前也经常玩的,今天放出一个基于Java的J2me手机版的,学习J2me编程的朋友有资料看了。 相关下载链接:[url=//download.csdn.net/download/gweibgood/2791081?utm_source=bbsseo]//download.csdn.net/download/gweibgood/2791081?utm_source=bbsseo[/url]
基于ARM嵌入式车载监控终端的设计与实现下载
基于ARM嵌入式车载监控终端的设计与实现 学习嵌入式要进哦 相关下载链接:[url=//download.csdn.net/download/pandongyang/3301722?utm_source=bbsseo]//download.csdn.net/download/pandongyang/3301722?utm_source=bbsseo[/url]
文章热词 机器学习教程 Objective-C培训 交互设计视频教程 颜色模型 设计制作学习
相关热词 mysql关联查询两次本表 native底部 react extjs glyph 图标 怎么学习互联网大数据 村干部学习大数据心得
我们是很有底线的