SujitKumar
SujitKumar

Reputation: 132

java.nio.BufferOverflowException at org.apache.struts2.util.FastByteArrayOutputStream.decodeAndWriteOut

Exception:

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at 
iconcept.filter.NavigationFilter.doFilter(NavigationFilter.java:107) at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at 
common.util.HibernateSessionRequestFilter.doFilter(HibernateSessionRequestFilter.java:117) at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at 
common.util.DisableUrlSessionFilter.doFilter(DisableUrlSessionFilter.java:57) 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:233) at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433) at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568) at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at 
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190) at 
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283) at 
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767) at 
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697) at 
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889) at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690) at 
java.lang.Thread.run(Thread.java:619) 
Caused by: Class: java.nio.HeapByteBuffer File: HeapByteBuffer.java Method: put Line: 165 - java/nio/HeapByteBuffer.java:165:-1 at 
org.apache.struts2.components.UIBean.end(UIBean.java:515) at 
org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42) at 
org.apache.jsp.admin.snsales.addPurchaseOrderAgrmnt_jsp._jspx_meth_s_005fcomponent_005f0(addPurchaseOrderAgrmnt_jsp.java:7012) at 
org.apache.jsp.admin.snsales.addPurchaseOrderAgrmnt_jsp._jspx_meth_s_005fif_005f8(addPurchaseOrderAgrmnt_jsp.java:6956) at 
org.apache.jsp.admin.snsales.addPurchaseOrderAgrmnt_jsp._jspx_meth_s_005fform_005f0(addPurchaseOrderAgrmnt_jsp.java:5227) at 
org.apache.jsp.admin.snsales.addPurchaseOrderAgrmnt_jsp._jspService(addPurchaseOrderAgrmnt_jsp.java:3178) at 
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) 
... 89 more 
Caused by: java.nio.BufferOverflowException at 
java.nio.HeapByteBuffer.put(HeapByteBuffer.java:165) at 
org.apache.struts2.util.FastByteArrayOutputStream.decodeAndWriteOut(FastByteArrayOutputStream.java:161) at 
org.apache.struts2.util.FastByteArrayOutputStream.writeTo(FastByteArrayOutputStream.java:94) at
org.apache.struts2.components.Include.include(Include.java:261) at 
org.apache.struts2.components.template.JspTemplateEngine.renderTemplate(JspTemplateEngine.java:58) at 
org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:559) at 
org.apache.struts2.components.UIBean.end(UIBean.java:513) 

... 97 more

Upvotes: -3

Views: 807

Answers (2)

Roman C
Roman C

Reputation: 1

The problem caused by the s:component tag, which is used to render template of the custom UI widget.

It works the same like s:include tag to write the content to the output stream. It uses FastByteArrayOutputStream to write the content to. It has a buffer with the size 8192. This buffer has been overflown.

It's probably a bug that has been fixed in the newer versions of Struts2 framework.

Upvotes: 0

akshay
akshay

Reputation: 1

you can set value in one variable and pass that variable to tag and send it to component jsp.

<s:set var="po" value="%{snPurchaseOrder}"></s:set>
        <s:push value="po">
        <jsp:include page="/template/xhtml/snsales/poComponentInfoNew.jsp">
    </jsp:include>
</s:push>

In child jsp you can access through #variable name like #po.

Upvotes: 0

Related Questions