NutzCN Logo
问答 怎麼 报空指针了啊?求解答
发布于 2823天前 作者 qq_7db27eef 1672 次浏览 复制 上一个帖子 下一个帖子
标签:
017-3-31 9:58:44.744 DEBUG [http-nio-8080-exec-4] Save object 'mainServiceImpl' to [app] 
2017-3-31 9:58:44.744 DEBUG [http-nio-8080-exec-4] Get TypeParams for self : com.weike.bean.School
17-03-31 09:58:44.750 WARN [http-nio-8080-exec-4] Error@/admin :
java.lang.NullPointerException
	at com.weike.ServiceImpl.BaseServiceImpl.getObjListByPager(BaseServiceImpl.java:54)
	at com.weike.ServiceImpl.MainServiceImpl.main(MainServiceImpl.java:46)
	at com.weike.action.main_action.main(main_action.java:153)
	at com.weike.action.main_action$$FASTCLASS._invoke(main_action.java:1)
	at org.nutz.lang.reflect.AbstractFastClass.invoke(AbstractFastClass.java:143)
	at org.nutz.lang.reflect.FastClassFactory.invoke(FastClassFactory.java:67)
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:198)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:789)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1437)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Unknown Source)

``` @IocBean(fields = { "dao" }) public abstract class BaseServiceImpl<T> extends IdEntityService<T> { protected final static int DEFAULT_PAGE_NUMBER = 20; public BaseServiceImpl() { super(); } public BaseServiceImpl(Dao dao) { super(dao); } public Pagination getObjListByPager(Integer pageNumber, int pageSize, Condition cnd) { pageNumber = getPageNumber(pageNumber); Pager pager = dao().createPager(pageNumber, pageSize); List<T> list = dao().query(getEntityClass(), cnd, pager); pager.setRecordCount(dao().count(getEntityClass(), cnd)); return new Pagination(pageNumber, pageSize, pager.getRecordCount(), list); } public QueryResult getObjListByPager(Integer pageNumber, int pageSize, Class cls) { QueryResult qr = new QueryResult(); Pager pager = dao().createPager(pageNumber, pageSize); pager.setRecordCount(dao().count(cls)); qr.setPager(pager); qr.setList(dao().query(School.class, null, pager)); return qr; } public Pagination getObjListByPager(Integer pageNumber, Condition cnd) { return getObjListByPager(pageNumber, DEFAULT_PAGE_NUMBER, cnd); } protected int getPageNumber(Integer pageNumber) { return Lang.isEmpty(pageNumber) ? 1 : pageNumber; } public void delete(String[] ids) { dao().clear(getEntityClass(), Cnd.where("id", "in", ids)); } }
添加回复
请先登陆
回到顶部