空指针异常,我看了一天半了,真的解决不了了,大神们啊,快帮着解决一下吧,在线等,急急急!!!

问题描述

空指针异常,我看了一天半了,真的解决不了了,大神们啊,快帮着解决一下吧,在线等,急急急!!!

java.lang.NullPointerException
at core.service.BaseService.doPaginationQuery(BaseService.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy106.doPaginationQuery(Unknown Source)
at com.jeefw.controller.sys.ReportController.getReport(ReportController.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:777)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:706)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at core.web.ChineseFilter.doFilter(ChineseFilter.java:30)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:150)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)

解决方案

at com.sun.proxy.$Proxy106.doPaginationQuery(Unknown Source)
at com.jeefw.controller.sys.ReportController.getReport(ReportController.java:70)
你自己看看再好好看看你的项目吧,一般没有验证把变量作为参数传递容易出现这个问题

解决方案二:

这个异常,就是你传参没有值导致的,一定要细心,而不是盲目的去看,你光贴一个错误,谁知道你干的啥,哪里有问题??

解决方案三:

// 查询部门的表格,包括分页、搜索和排序
@RequestMapping(value = "/getReport", method = { RequestMethod.POST, RequestMethod.GET })
public void getReport(HttpServletRequest request, HttpServletResponse response) throws Exception {
Integer firstResult = Integer.valueOf(request.getParameter("page")); //获取页面的起始条数
Integer maxResults = Integer.valueOf(request.getParameter("rows")); //获取页面的最大条数
String sortedObject = request.getParameter("sidx"); //获取id
String sortedValue = request.getParameter("sord"); //设置id的排序方式
String filters = request.getParameter("filters"); //过滤字符串
Report report = new Report(); //实例化Model类
if (StringUtils.isNotBlank(filters)) {
JSONObject jsonObject = JSONObject.fromObject(filters);
System.out.println("执行rules了++++++++++++"+jsonObject.get("rules"));
JSONArray jsonArray = (JSONArray) jsonObject.get("rules");
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject result = (JSONObject) jsonArray.get(i);
System.out.println("执行op了++++++++++++"+result.getString("op"));
if (result.getString("field").equals("title") && result.getString("op").equals("cn")) {
System.out.println(result.getString("data"));
report.setTitle(result.getString("data"));
}
}
if (((String) jsonObject.get("groupOp")).equalsIgnoreCase("OR")) {
report.setFlag("OR");
} else {
report.setFlag("AND");
}
}
report.setFirstResult((firstResult - 1) * maxResults); //设置页面的起始数字
report.setMaxResults(maxResults); //设置页面的最大结果数
Map sortedCondition = new HashMap(); //设置Map集合
sortedCondition.put(sortedObject, sortedValue); //
report.setSortedConditions(sortedCondition);
** QueryResult queryResult = reportService.doPaginationQuery(report);
**

JqGridPageView reportListView = new JqGridPageView();
reportListView.setMaxResults(maxResults);
List reportCnList = reportService.queryReportCnList(queryResult.getResultList());
reportListView.setRows(reportCnList);
reportListView.setRecords(queryResult.getTotalCount());
writeJSON(response, reportListView);
}

    debug时一到QueryResut是就不能往下执行了,说找不见report这个类,这是用到的model类,debug时我也在看,上边的都能拿到数据,但一到这就出问题

解决方案四:

把代码粘一下吧,报空指针主要是 调用空值了,或者自己debug一下看看哪行报错

时间: 2024-11-01 18:58:35

空指针异常,我看了一天半了,真的解决不了了,大神们啊,快帮着解决一下吧,在线等,急急急!!!的相关文章

c++-大神请进,帮小孩看一下他的算法,点评点评。

问题描述 大神请进,帮小孩看一下他的算法,点评点评. 问题如下: 算法如下: Algorithm for the programming assignment #2 Algorithm for the game of absorb material Step1: Welcome the user and explain the purpose of how to use this program to play Step1a: Display a heading ("absorbing mate

初学者-各位大神,能不能帮看一下问题是在哪,一直提示错误,改了好多遍都没还对

问题描述 各位大神,能不能帮看一下问题是在哪,一直提示错误,改了好多遍都没还对 package jsp; public class Circle { double side; double areaperimeter; public void setCircle(double r){ side=r; } public double getCircle(){ return side; } public double getArea(){ area=Math.sqrt(3.14*side*side)

帮忙看一下,java连接数据的问题!!求大神帮忙

问题描述 帮忙看一下,java连接数据的问题!!求大神帮忙 解决方案 解决方案二: 解决方案三: 求大神帮忙啊!!!!!!!!!!!!!!!!!!! 解决方案四: 看你的jar包,你的sqlserver应该是2008版本,换个jar包,sqljdbc4 解决方案五: 应该是版本不对,或者driverStr写错了 解决方案六: buildpath里看下jar包添加了没有.如果添加了可以试一下把项目重新编译一下,再不行可能是版本不对,换个驱动包 解决方案七: 驱动类找不到,检查下你的驱动jar包有没

matlab simulink-请大神看看我的自抗扰控制框图搭的是否正确

问题描述 请大神看看我的自抗扰控制框图搭的是否正确 请大神帮忙看看是否正确? 解决方案 http://www.ilovematlab.cn/thread-453705-1-1.html

ora-00907-请大神看下这个语句语法改成什么样才没有问题

问题描述 请大神看下这个语句语法改成什么样才没有问题 请大神看下这个语句语法改成什么样才没有问题 SELECT qu.id, qu.belong, qu.type, qu.title, qu.flag, (SELECT wm_concat(as_num || '-' || as_info) FROM QUESTION_ANSWER quas WHERE quas.qu_id = qu.qu_id order by quas.as_sort asc ) AS qu_answers FROM QUE

急急急急急-大神帮我看下log cat 哪错了 本人菜鸟

问题描述 大神帮我看下log cat 哪错了 本人菜鸟 求大神解答 哪里错了 本人刚刚才学习做 不懂的看log cat 求大神帮看下哪里出错了 急急急急 解决方案 图片较为模糊,不过我看到了报空指针异常,并且好像是listview引起的,你看看是不是listview初始化了但是没有赋值,比如listview = findViewById(R.id.listview);不懂的可以加我. 解决方案二: 实在看不清啊,不过看样子有异常抛出发生JE 了,这个错误应该好定位

求大神解答android 空指针异常

问题描述 求大神解答android 空指针异常 新人,超级小白一枚.找了一个多小时实在找不错哪里错了....求帮忙. 解决方案 从代码上看不到问题, 我拿你的代码在我这跑了一下没有问题可以运行起来, 很奇怪!!你看看你的清单文件中的配置, 关于activity的配置, 贴一下看看 解决方案二: 解决方案三: 清理下项目,检查下包声明的路径

图片-拜托各位大神看下,有个报错空指针,试了一天了。诶~。~、、

问题描述 拜托各位大神看下,有个报错空指针,试了一天了.诶~.~.. 代码白底处便是50行. 解决方案 解决方案二: 表示大神都不知道,b=null 解决方案三: getIntent().getExtras()返回的对象可能为空.在b为null时,调用getString方法会报空指针异常. 改为以下代码即可: Bundle b = getIntent().getExtras(); if( b != null) String str = b.getString("FILE_PATH");

jsp-没有找到空指针异常,求大神指导

问题描述 没有找到空指针异常,求大神指导 org.apache.jasper.JasperException: An exception occurred processing JSP page /doSaveStudent.jsp at line 21 18: SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 19: student.setBorn(sdf.parse(born)); 20: StudentDao s