浏览器报错 Apache Tomcat/7.0.29 - Error report
HTTPStatus500-Requestprocessingfailed;nestedexceptionisjava.lang.IndexOutOfBoundsExce...
HTTP Status 500 - Request processing failed; nested exception is java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
type Exception report
message Request processing failed; nested exception is java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
description The
server encountered an internal error (Request processing failed; nested
exception is java.lang.IndexOutOfBoundsException: Index: 0, Size: 0)
that prevented it from fulfilling this request.
exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:948)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107
root cause
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
java.util.ArrayList.RangeCheck(ArrayList.java:547)
java.util.ArrayList.get(ArrayList.java:322)
com.dayainfo.ssp.index.SQLCreatReader.setReader(SQLCreatReader.java:86)
com.dayainfo.ssp.index.SQLCreatReader.getReader(SQLCreatReader.java:41)
com.dayainfo.ssp.subjectSearch.controller.SubjectSearchControll.handleSearch(SubjectSearchControll.java:47) 展开
type Exception report
message Request processing failed; nested exception is java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
description The
server encountered an internal error (Request processing failed; nested
exception is java.lang.IndexOutOfBoundsException: Index: 0, Size: 0)
that prevented it from fulfilling this request.
exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:948)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107
root cause
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
java.util.ArrayList.RangeCheck(ArrayList.java:547)
java.util.ArrayList.get(ArrayList.java:322)
com.dayainfo.ssp.index.SQLCreatReader.setReader(SQLCreatReader.java:86)
com.dayainfo.ssp.index.SQLCreatReader.getReader(SQLCreatReader.java:41)
com.dayainfo.ssp.subjectSearch.controller.SubjectSearchControll.handleSearch(SubjectSearchControll.java:47) 展开
展开全部
这不是已经告诉你错误了吗,IndexOutOfBoundsException,这是下标溢出错误,可能是你程序中的数组或集合为空了,你没判断直接取值了…………
追问
怎么解决呢?
追答
我看你用的是ArrayList吧,你可以先判断ArrayList的对象是否等于NULL,或者对象的size是否等于0,如果成立,那就不能取值了。
比如:
ArrayList arr;
........//arr经过一系列操作
if(arr!=null && arr.size()>0){
//这里就可以取值了。
}else{
//这里就不能取值了
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2015-03-13
展开全部
你缺少lucene的包,检测到此处,无数据,所以报红。IndexOutOfBoundsException,这是下标溢出错误。
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询