JsonRender java.nio.BufferOverflowException异常问题,求助~~

pandyyan 发布于 2013/11/29 15:26
阅读 1K+
收藏 0

@JFinal 你好,想跟你请教个问题:

我程序中代码如下:第一次请求该action时,偶尔报错,请问是什么原因呢?谢谢!

List<UserInfo> list = UserInfo.dao.findByIdAndUsername(username);
setAttr("obj", list);
render(new JsonRender().forIE());



java.nio.BufferOverflowException
	at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:343)
	at org.apache.coyote.http11.InternalAprOutputBuffer$SocketOutputBuffer.doWrite(InternalAprOutputBuffer.java:240)
	at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:119)
	at org.apache.coyote.http11.AbstractOutputBuffer.doWrite(AbstractOutputBuffer.java:192)
	at org.apache.coyote.Response.doWrite(Response.java:505)
	at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:383)
	at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:462)
	at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:334)
	at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:306)
	at org.apache.catalina.connector.CoyoteWriter.flush(CoyoteWriter.java:98)
	at com.jfinal.render.JsonRender.render(JsonRender.java:106)
	at com.jfinal.core.ActionHandler.handle(ActionHandler.java:92)
	at com.hikvision.handler.SessionResourcesHandler.handle(SessionResourcesHandler.java:48)
	at com.jfinal.plugin.druid.DruidStatViewHandler.handle(DruidStatViewHandler.java:74)
	at com.jfinal.ext.handler.ContextPathHandler.handle(ContextPathHandler.java:47)
	at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1822)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:722)



@缪斯的情人 @绝望的八皮 @alvinte @玛雅牛 多谢各位!!!

加载中
0
缪斯的情人
缪斯的情人
用的maven编译的吗?缓冲区设置大一些
pandyyan
pandyyan
是maven编译的,哪里的缓冲区设置大一点呢?
0
JFinal
JFinal

下面这句返回的数据量有多大:

List<UserInfo> list = UserInfo.dao.findByIdAndUsername(username);

另外,如果只响应上面的 list,建议写成这样:

render(new JsonRender("obj", list).forIE());



pandyyan
pandyyan
数据量大概就四五千条吧,也不是很大吧?
返回顶部
顶部