NutzCN Logo
问答 log4j在debug模式下一切正常,在info模式下出异常
发布于 2603天前 作者 qq_1d84c364 1700 次浏览 复制 上一个帖子 下一个帖子
标签:

错误日志

l[INFO ] 14:35:28.387 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:141) - Nutz.Mvc[nutz] is up in 2019ms
30-Sep-2017 14:35:28.414 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /iteasy/tomcat/tomcat-jy-7004/webapps/ROOT has finished in 11,996 ms
30-Sep-2017 14:35:28.418 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-7004"]
30-Sep-2017 14:35:28.426 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-7409"]
30-Sep-2017 14:35:28.428 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 12072 ms
[WARN ] 14:35:31.239 org.nutz.dao.impl.entity.AnnotationEntityMaker.make(AnnotationEntityMaker.java:117) - No @Table found, fallback to use table name='standard_table_row' for type 'com.easysoft.entity.StandardTableRow'
[WARN ] 14:35:31.623 org.nutz.mvc.impl.processor.FailProcessor.process(FailProcessor.java:28) - Error@/standard/doLoadStandard :
org.nutz.dao.DaoException: java.lang.ArrayIndexOutOfBoundsException: 1
	at org.nutz.dao.impl.sql.run.NutDaoRunner._runWithoutTransaction(NutDaoRunner.java:139)
	at org.nutz.dao.impl.sql.run.NutDaoRunner._run(NutDaoRunner.java:92)
	at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:81)
	at org.nutz.dao.impl.DaoSupport.run(DaoSupport.java:240)
	at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:252)
	at org.nutz.dao.impl.DaoSupport.execute(DaoSupport.java:236)
	at org.nutz.dao.impl.NutDao.execute(NutDao.java:1008)
	at com.easysoft.service.StandardService.getStandardList(StandardService.java:123)
	at com.easysoft.controller.StandardController.doLoadStandard(StandardController.java:129)
	at com.easysoft.controller.StandardController$FM$doLoadStandard$50c48f684fbc77ff250702399cde55c9.invoke(StandardController.java)
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:31)
	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 com.easysoft.MyEncodeProcessor.process(MyEncodeProcessor.java:11)
	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:202)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
	at org.nutz.dao.impl.sql.run.NutDaoExecutor._runSelect(NutDaoExecutor.java:269)
	at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:53)
	at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:66)
	at org.nutz.dao.impl.interceptor.DaoLogInterceptor.filter(DaoLogInterceptor.java:22)
	at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:64)
	at org.nutz.dao.DaoInterceptorChain.invoke(DaoInterceptorChain.java:139)
	at org.nutz.dao.impl.sql.run.NutDaoRunner.runCallback(NutDaoRunner.java:158)
	at org.nutz.dao.impl.sql.run.NutDaoRunner._runWithoutTransaction(NutDaoRunner.java:125)
	... 44 more

log4j

log4j.rootLogger=info,Console

log4j.appender.Console.MaxBackupIndex=3

log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=[%-5p] %d{HH:mm:ss.SSS} %l - %m%n

版本:1.r.62
sql模板

/*getValStandarList*/
select a.*, b.nickName from tvalstandard a
LEFT JOIN tcommonloginuser b on b.id = a.createUserId
where a.companyId = @companyId  
<% if (has("searchText")) {%>
	and  CONCAT(a.`no`,a.`name`,a.remark,b.nickName) like @searchText 
<% } %>
ORDER BY a.createTime desc
12 回复
public QueryResult getStandardList(int pageNum, int pageSize, String searchText, Long companyId){
		Sql sql = dao.sqls().create("getValStandarList").setCallback(Sqls.callback.entities());
		sql.setParam("companyId", companyId);
		if (StringUtil.isNotNull(searchText)){
			searchText = "%" + searchText + "%";
			sql.params().set("searchText", searchText);
		}
		sql.setEntity(dao.getEntity(StandardTableRow.class));
		dao.execute(sql);//这就是错误提示的123行
		Pager pager = dao.createPager(pageNum, pageSize);

		List<StandardTableRow> list = sql.getList(StandardTableRow.class);
		pager.setRecordCount(list.size());
		return new QueryResult(list, pager);
	}

你的sql没设置回调呢

Sql sql = dao.sqls().create("getValStandarList").setCallback(Sqls.callback.entities());
这不算是回调吗?

哦,原来在后面

debug一下NutDaoExecutor,看看哪里的问题吧

这个StandardTableRow并非pojo?

嗯 这个不对应数据库表

那用record取出来,然后toPojo试试吧

不用pojo可以的,有没有稍微便利的方法,代码里面这样的写法很多啊

还不如把info改为debug算了

直接把log4j.properties删了也行,调查一下呢?感觉不是大问题

log4j的日志级别只是触发条件,并非原因

添加回复
请先登陆
回到顶部