java.lang.StringIndexOutOfBoundsException: String index out of range: -6 [问题点数:20分,结帖人gaozhi0]

Bbs2
本版专家分:255
结帖率 99.18%
Bbs6
本版专家分:8406
Blank
黄花 2009年10月 Java大版内专家分月排行榜第二
Bbs2
本版专家分:255
Bbs4
本版专家分:1384
Bbs2
本版专家分:255
Bbs2
本版专家分:255
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: 0
一jsp文件将查询结果分类存入一些数组然后显示,google上查了不少,但都没答案。请高手指教这类问题一般出在那里:rn--- Exception Detail ----------------------rnjava.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: 0rn at java.lang.String.charAt(String.java:460)rn at jsp_servlet._ex._excc._exccpp._exccpp001.__exccpp001result._jspService(__exccpp001result.java:495)rn at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)rn at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)rn at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)rn at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)rn at weblogic.servlet.internal.RequestDispatcherImpl$ForwardAction.run(RequestDispatcherImpl.java:382)rn at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)rn at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)rn at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:286)rn at jp.co.nec.ome.servlet.OmAbstractRequestPattern.displayRedirectPage(OmAbstractRequestPattern.java:513)rn at jp.co.pc_daiwabo.c1.c1cc.servlet.C1CCEJBDefaultRequest.processRequest(C1CCEJBDefaultRequest.java:218)rn at jp.co.pc_daiwabo.c1.c1cc.servlet.C1CCEJBControlServlet.dispatchRequestPattern(C1CCEJBControlServlet.java:616)rn at jp.co.nec.ome.servlet.OmControlServlet.doPost(OmControlServlet.java:758)rn at jp.co.nec.ome.servlet.OmEJBControlServlet.doPost(OmEJBControlServlet.java:328)rn at jp.co.pc_daiwabo.c1.c1cc.servlet.C1CCEJBControlServlet.doPost(C1CCEJBControlServlet.java:545)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)rn at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)rn at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)rn at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)rn at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)rn at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)rn at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)rn at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)rn at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)rn at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)rn at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)rnrn
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
HTTP Status 500 - 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
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相关的代码贴出来了,但不是很理解这个数组怎么就越界了。也不知道怎么去修改
Mybatis批量插入index out of range错误(较偏的错误)
批量插入,错误是何,拒绝转载!前言原因改进ndn前言n往往我们看到网上关于各类关于批量插入报这种错误的文章都是传入的集合为null,或者是参数获取不对等等,但是在开发的时候同事遇到了这种类型的错误,我一直以为是网上那些博客那些原因造成的,于是,两只眼睛一直盯着代码看来许久都没有找出什么问题。那是什么问题呢?n原因n是由于项目中用的是sharding-jdbc来进行数据库连接,而sharding-j...
root cause java.lang.StringIndexOutOfBoundsException: String index out of range
HTTP Status 500 -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.
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
java.lang.StringIndexOutOfBoundsException:String index out of range:-1
程序如下:rnrn包上述错误,没见过怎么回事?
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老是说 字符串索引超出范围 到底哪里错了????
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...
String index out of range: -6 的错误
初次使用hibernate,然后将一个页面中的数据插入到数据库中时,就阴魂不散的发生了这个错误,我插入的值只是一位:“1”,却总是报这个错,有谁也碰到过这个问题吗?
爬取淘宝评论时出现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...
(上传问题)java.lang.StringIndexOutOfBoundsException: String index out of range: -63657
大家好! 小弟为这事苦恼许久。rnrnjava.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: -63657rnrn错误原因是上传文件导致的。rnrn上传组件:jspSmartUpload.jarrnrn测试图片:pic01.jpgrnrn分辨率为:400×400rnrn大小:66.1 KB (67,704 字节)rnrn占用:80.0 KB (81,920 字节)rnrn本地测试上传,没有错误。但是将程序上传到服务器后,在服务器上测试的时候个别图片就会报错。rnrn不知道大家有没有碰到过这类事情?rnrn请帮小弟解惑! 在此谢过了!
救命啊!!!老是报java.lang.StringIndexOutOfBoundsException: String index out of range: 16?????
我在 往SQLSERVER中循环插入1-1000的ID的时候老是报java.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: 16,代码如下:rn try rn // connection= DriverManager.getConnection(url11,user11,password11); rn connection.setAutoCommit(false);// 事物处理 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(url11,user11,password11); rn stmt=connection.createStatement();rn iTmp=stmt.executeUpdate(SQL); rn SQL="";rn rn qskh1=qskh1+1;rn qskh=String.valueOf(qskh1);rn SQL=""; rn rn if(iTmp>0)rn <em>out</em>.println(" ");rn elsern <em>out</em>.println(" ");rn rn rn catch(SQLException e)rn <em>out</em>.print(e);rn connection.rollback();rn
JStorm UI问题排查
现象n点击一个topolog的页面,发现出现错误。njava.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: -2n java.lang.String.sub<em>string</em>(String.java:1967)n com.alibaba.jstorm.ui.tags.ErrorTag.getErrorContent(Er...
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] ==
奇怪的 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>: 5000rnrn帮我看下怎么会错的?
String index out of range: -1
String <em>index</em> <em>out</em> of <em>range</em>: -1rnrn是怎么回事啊 rnrn谢谢
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文件(我是自己写了一个简单的矩形框标注工具,生成相应
raft之 为什么不能直接commit 上一个term的entry
n n n nnnnn屏幕快照 2017-07-03 下午5.56.36.pngnn上图中, 最上面表示的<em>index</em>, S1~S5分别表示的是服务器, (a)~(b) 代表了不同的场景, 每个小块中的数字表示了itemid。n现分析如下:n(a) 场景: S1是leader,termId是2,写了一条日志到S1和S2,当前机群表示的leader表示为(termI...
python3实现《机器学习实战》遇到的问题:range函数
最近在看学习《机器学习实战》这本书。这本书上用的python2的语法,和python3的语法不太一样。由于本人python小白,看了python3的语法,准备自己实现一下代码,遇到了一些问题,故开贴记录一下。rnrnrn书上P82页。书上给出的dataIndex=<em>range</em>(m)然后循环最后一句是rndel(dataIndex[randIndex])rnpython3中这样报错了。rn结果发现原来
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...
StringUtil:字符串处理的工具类
一个字符串处理的工具类(●’◡’●) n包含以下功能:判断应用程序是否安装 n字符拆分成数组 nMD5 加密 n拼接后的字符串 n替换字符串 n判断多个参数是否都为空 n将字符串转换成HTML格式的字符串 n将HTML格式的字符串转换成常规显示的字符串 n获取加密的手机号 n检查手机号 n验证固定电话号码 n检查密码有效 n根据<em>string</em>.xml资源格式化字符串 n验证身份证号码 n将元单位数字转
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:6 请问这个错误信息是什么意思
String <em>index</em> <em>out</em> of <em>range</em>:6 请问这个错误信息是什么意思rnrn那位高手能给点意见阿
String index out of range: -1 异常,急需处理
nnnn  
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: 500?
请教大家: rn我在数据录入时把好几个字段用"*"分开,存储在一个字段中。在从数据库中取出数据时,语句如下. rnResultSet rs=st.executeQuery("select * from tblMain"); rnrs.next(); rnString resip=rs.getString("resipID"); rnzym=rs.getString("title"); rnfujiazym=rs.getString("titleAlternative"); rnint m=fujiazym.length(); rnint i=0; rnint j=0; rnint k=0; rnString fjzym[]; rnfjzym=new String[20]; rnrnwhile(!(fujiazym.equals("*"))) rnj=fujiazym.<em>index</em>Of('*'); rnk++; rnfjzym[k]=fujiazym.sub<em>string</em>(i,j); rnfujiazym=fujiazym.sub<em>string</em>(j+1,m); rn rn执行后出现错误提示, rnjava.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: 500 rn我的数据库中的titleAlternative字段大小是500.请教是何原因rnrn
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> 的错误,请各位知道的加以指点
求助: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!!异常 但是自己也没有使用过数组之类的容器,求各位大大帮助,已经纠结两天了!
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>
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
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...
工作中遇到的问题之异常
今天在工作中执行项目的时候遇到了一个异常rn1.java.lang.StringIndexOutofBoundException:String <em>index</em> <em>out</em> of <em>range</em>:4rn异常的原因是:表示越界了,你的字符串没有这么大的长度。rn2.在equals中添加参数需要加引号,不加引号 不会报错但是不会之执行这段代码。之前没有注意过这个问题,经过这次遇到这个问题之后,以后会注意这个问题的。
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是这个异常。
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看了网上的答案,发现好多坑...
数据库最后一个字段Null导致mybatis抛出异常ArrayIndexOutOfBoundsException
数据库最后一个字段Null导致mybatis抛出异常ArrayIndexOutOfBoundsExceptionmybatis抛出异常ArrayIndexOutOfBoundsException项目框架出错原因解决方法nmybatis抛出异常ArrayIndexOutOfBoundsExceptionn项目框架nSpring boot1.5.9 + mybatis3 + mysql-conecto...
遇到的 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...
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
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错误!高手帮忙啊!
tomcat启动出现Caused by: java.lang.StringIndexOutOfBoundsException: String index out
亲爱的各位···我在MYSQL项目向ORACLE移值的时候出现一个错误可是却不知道怎么办只好向各位求助,各位帮忙啊!!具体错误如下:(这是在TOMCAT启动项目时候报的错··)rnrnrn严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: 0rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)rn at org.apache.catalina.core.StandardService.start(StandardService.java:519)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:581)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)rnCaused by: java.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: 0rn at java.lang.String.charAt(String.java:687)rn at org.hibernate.mapping.Table.setName(Table.java:149)rn at org.hibernate.cfg.Mappings.addTable(Mappings.java:167)rn at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:290)rn at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:273)rn at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:144)rn at org.hibernate.cfg.Configuration.add(Configuration.java:669)rn at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:504)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:631)rn at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)rn ... 39 morern2011-6-9 9:47:50 org.apache.catalina.core.StandardContext startrn严重: Error listenerStartrn2011-6-9 9:47:50 org.apache.catalina.core.StandardContext startrn严重: Context [/Shanwei] startup failed due to previous errors
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出现如下提示,但是服务并没发生中断之类的错误。这个问题是什么原因导致呢。该如何解决呢
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>>>
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
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([[...
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...
《机器学习实战》-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:
【学习笔记】python数据处理
numpyrnrnrn数组 rn创建数组rnrnrnrnrna = np.array([2, 0, 1, 5]) #创建数组rnrnrn引用rnrnrnrnrna[:3] #引用前三个数字(切片)rnrnrn将data转换为bool类型rnrnrnrnrndata == u'好' # 数组转换为bool类型rndata[data == u'是'] #用布尔类型数组来取data的值rnrnrn二维数组rnrnrnrnrnb= np.array([[1, 2, 3]...
使用hadoop编写mapreduce程序的注意点
rn编程时需要注意:rn1、实例化job后,不要再使用原来的configuration,而需通过job.getCongfigure()来进行参数的配置rn rnpublic static Job createSubmittableJob(Configuration conf, String[] args) rn throws IOException {rn String tableName = ...
代码折叠工具 For Eclipse ——修复版
针对此错误的修复版 java.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: 45 at java.lang.String.charAt(Unknown Source) at com.cb.eclipse.folding.java.calculation.UserDefinedRegionHelper.isSentinel(UserDefinedRegionHelper.java:53) 使用方法如下:http://my.oschina.net/axes/blog/124714 他的jar包是未修复版的。大家可以测试。测试方法:在代码后边直接写两个斜杠,示例如下: private Object mObject;// 就会报我上边贴的错误。
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)))
CP2K运行时显示Index to radix array not found 错误的解决方法
有时体系过大,cp2k运行时显示Index to radix array not found错误,此时在脚本的&GLOBAL中加上:rnEXTENDED_FFT_LENGTHS Trn即可
Error #: 2301 : internal compiler error: java.lang.StringIndexOutOfBoundsException: String index out of range: 26454
这是什么原因呢,在线等待。rn我用的是jb+jboss3.2+tomcat4.1.24rn
急急...送分。。关于JSP的错误:java.lang.StringIndexOutOfBoundsException: String index out of range: -1??
rn 在一个FOR循环中,我至少调用了十多个String类型,运行JSP程序有的时候可以执行,rn有时出现错误:rnjava.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: -1rnrn 怎样释放String?? 怎样解决这个错误??
对于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...
python机器学习及实践(从零开始kaggle竞赛之路)第二章的2.1.2.5集成模型程序报错:numpy.core._internal.AxisError: axis 0 is out of bo
python机器学习及实践(从零开始kaggle竞赛之路)第二章的2.1.2.5集成模型程序报错:numpy.core._internal.AxisError: axis 0 is <em>out</em> of bounds for array of dimension 0:1.原因是本段代码在python3以上执行时:print(np.sort(zip(etr.feature_importances_,bost...
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
目标检测: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
设计模式可复用面向对象软件的基础下载
所有结构良好的面向对象软件体系结构中都包含了许多模式。 相关下载链接:[url=//download.csdn.net/download/beiqi5656/2428001?utm_source=bbsseo]//download.csdn.net/download/beiqi5656/2428001?utm_source=bbsseo[/url]
bada 开发文档 1下载
bada 各个模块的 介绍文档 1 badaTutorial 相关下载链接:[url=//download.csdn.net/download/blueshell2005/2646247?utm_source=bbsseo]//download.csdn.net/download/blueshell2005/2646247?utm_source=bbsseo[/url]
计算机二级C语言机试题目(详解)下载
希望对参加计算机二级考试的你有些帮助,祝你通过考试!! 相关下载链接:[url=//download.csdn.net/download/zhangyonggang09161/3123920?utm_source=bbsseo]//download.csdn.net/download/zhangyonggang09161/3123920?utm_source=bbsseo[/url]
文章热词 机器学习教程 Objective-C培训 交互设计视频教程 颜色模型 设计制作学习
相关热词 mysql关联查询两次本表 native底部 react extjs glyph 图标 上海python培训6 nlp深度学习6
我们是很有底线的