A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

private void get()
{

List<CustContactMVO> curentResult = new ArrayList<CustContactMVO>();
CustContactMVO m1=new CustContactMVO();
m1.setContactId("001");
curentResult.add(m1);
PagView pagview=new PagView();
pagview.setCount(7);
pagview.setPagCount(3);
pagview.setPagNo(0);
pagview.setPagSize(2);
pagview.setViewList(curentResult);
current.setPagView(pagview);

}
这段程序引发了空指针异常,求解释?

严重: Servlet.service() for servlet DPTW threw exception
java.lang.NullPointerException
at java.lang.StringBuilder.<init>(StringBuilder.java:92)
at com.cattsoft.mscrm.common.struts2.interceptor.RequestExceptionHandler.handle(RequestExceptionHandler.java:51)
at com.cattsoft.mscrm.common.struts2.interceptor.ApplicationMasterFilter.doFilter(ApplicationMasterFilter.java:141)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Thread.java:619)

3 个回复

正序浏览
current.setPagView(pagview);current变量实例化了没?
回复 使用道具 举报
根据楼主上面的代码看,每个变量都有值啊,你用debug模式跟踪一下,看看
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马