Beehive
  1. Beehive
  2. BEEHIVE-716

Page partially rendered if error occurs in included page

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: NetUI
    • Labels:
      None

      Description

      From email with Richard Feit (read from the bottom):

      Ah, the exception is getting thrown at the end of page rendering, basically during the control's end-of-request callback. The issue is that part of the outer page has already written to the response. I think this is worth a bug, although it should be filed under TBD and not v1.0. I'm not sure if there's anything we can do, but we might be able to make the error-handling behavior different for included pages.

      Scott Semyan wrote:

      >The error is being generated down within a control being called by a
      >control being called by a control being called by a page flow
      >However, I think this error is being caught in the sharedflow here:
      >
      > @Jpf.ExceptionHandler(
      > forwards=

      { > @Jpf.Forward(name="errorPage", >path="/resources/beehive/version1/jsps/error.jsp") > }

      > )
      > protected Forward handleDataStoreException(DataStoreException ex,
      >String actionName, String message, Object form)

      { > System.err.print("[" + getRequest().getContextPath() + "] "); > System.err.println("DataStore exception caught in >SharedFlow.jpfs:"); > ex.printStackTrace(); > return new Forward("errorPage"); > }

      >
      >Here is the full stack trace.
      >
      >- PreparedStatement: insert into orders (userId, totalPrice,
      >creditCard, exprDate, cardType, status, shippingAddress,
      >billingAddress) values (?, ?, ?, ?, ?, 'OK', ?, ?) Params:

      {beehive, >18.50, 098098, jgh, Visa, 1, 1}

      >- PreparedStatement: select max(orderId) from Orders where userId = ?
      >Params:

      {beehive}

      >- PreparedStatement: update Items set inventoryQuantity = ? where
      >itemId = ? Params:

      {1, EST-4}

      >- PreparedStatement: insert into orderitems values (?, ?, ?) Params:
      >

      {2, EST-4, 1}

      >- Attempting to instantiate SharedFlowControllers for request
      >/petstoreWeb/checkout/viewOrder.do
      >- PreparedStatement: select orderId, userId, orderDate, totalPrice,
      >creditCard,exprDate, cardType, status, shippingAddress, billingAddress
      >from Orders where orderId = ? and userId = ? Params:

      {2, beehive}

      >- PreparedStatement: select addressId, userId, name, phone, addr1,
      >addr2, city, state, zip, country from Addresses where addressId = ?
      >Params:

      {1}
      >- PreparedStatement: select addressId, userId, name, phone, addr1,
      >addr2, city, state, zip, country from Addresses where addressId = ?
      >Params: {1}

      >- PreparedStatement: select o.itemId, productId, listPrice, unitCost,
      >supplier, status, attr1, inventoryQuantity as Qty, o.quantity from
      >OrderItems o, Items i where o.orderId = ? and o.itemId = i.itemId
      >Params:

      {2}

      >- Label: expression null resolved to null, using empty string.
      >- Handling uncaught Throwable
      >org.apache.beehive.controls.api.ControlException
      >- Could not find exception handler method handleException for
      >org.apache.beehive.controls.api.ControlException.
      >- Could not find exception handler method handleException for
      >java.lang.RuntimeException.
      >[/petstoreWeb] Unhandled exception caught in SharedFlow.jpfs:
      >org.apache.beehive.controls.api.ControlException: SQL Exception while
      >attempting to close database connection.[Invalid transaction state.]
      > at
      >org.apache.beehive.controls.system.jdbc.JdbcControlImpl.onRelease(JdbcC
      >o
      >ntrolImpl.java:133)
      > at
      >org.apache.beehive.controls.system.jdbc.JdbcControlImplInitializer$_res
      >o
      >urceContextResourceEventsEventAdaptor.onRelease(JdbcControlImplInitiali
      >z
      >er.java:20)
      > at
      >org.apache.beehive.controls.runtime.bean.ResourceContextImpl.release(Re
      >s
      >ourceContextImpl.java:144)
      > at
      >org.apache.beehive.controls.runtime.bean.ControlContainerContext.releas
      >e
      >Resources(ControlContainerContext.java:136)
      > at
      >org.apache.beehive.controls.runtime.bean.ControlContainerContext.endCon
      >t
      >ext(ControlContainerContext.java:64)
      > at
      >org.apache.beehive.controls.runtime.servlet.ServletBeanContext.endConte
      >x
      >t(ServletBeanContext.java:92)
      > at
      >org.apache.beehive.netui.pageflow.internal.JavaControlUtils.uninitializ
      >e
      >ControlContext(JavaControlUtils.java:85)
      > at
      >org.apache.beehive.netui.pageflow.PageFlowPageFilter.doFilter(PageFlowP
      >a
      >geFilter.java:224)
      > at
      >org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
      >a
      >tionFilterChain.java:186)
      > at
      >org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
      >t
      >erChain.java:157)
      > at
      >org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispat
      >c
      >her.java:704)
      > at
      >org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDis
      >p
      >atcher.java:590)
      > at
      >org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispa
      >t
      >cher.java:510)
      > at
      >org.apache.beehive.netui.tags.template.IncludeSection.callDefault(Inclu
      >d
      >eSection.java:279)
      > at
      >org.apache.beehive.netui.tags.template.IncludeSection.doStartTag(Includ
      >e
      >Section.java:233)
      > at
      >org.apache.jsp.site.template_jsp._jspx_meth_netui$1template_includeSect
      >i
      >on_1(template_jsp.java:312)
      > at
      >org.apache.jsp.site.template_jsp._jspx_meth_netui_body_0(template_jsp.j
      >a
      >va:232)
      > at
      >org.apache.jsp.site.template_jsp._jspx_meth_netui_html_0(template_jsp.j
      >a
      >va:163)
      > at
      >org.apache.jsp.site.template_jsp._jspService(template_jsp.java:86)
      > at
      >org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
      > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      > at
      >org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.j
      >a
      >va:324)
      > at
      >org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
      > at
      >org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
      > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      > at
      >org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
      >a
      >tionFilterChain.java:237)
      > at
      >org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
      >t
      >erChain.java:157)
      > at
      >org.apache.beehive.netui.pageflow.PageFlowPageFilter.runPage(PageFlowPa
      >g
      >eFilter.java:279)
      > at
      >org.apache.beehive.netui.pageflow.PageFlowPageFilter.doFilter(PageFlowP
      >a
      >geFilter.java:204)
      > at
      >org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
      >a
      >tionFilterChain.java:186)
      > at
      >org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
      >t
      >erChain.java:157)
      > at
      >org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispat
      >c
      >her.java:704)
      > at
      >org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDis
      >p
      >atcher.java:590)
      > at
      >org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispa
      >t
      >cher.java:510)
      > at
      >org.apache.beehive.netui.tags.template.Template.doEndTag(Template.java:
      >2
      >80)
      > at
      >org.apache.jsp.checkout.viewOrder_jsp._jspx_meth_netui$1template_templa
      >t
      >e_0(viewOrder_jsp.java:232)
      > at
      >org.apache.jsp.checkout.viewOrder_jsp._jspService(viewOrder_jsp.java:97)
      > at
      >org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
      > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      > at
      >org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.j
      >a
      >va:324)
      > at
      >org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
      > at
      >org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
      > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      > at
      >org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
      >a
      >tionFilterChain.java:237)
      > at
      >org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
      >t
      >erChain.java:157)
      > at
      >org.apache.beehive.netui.pageflow.PageFlowPageFilter.runPage(PageFlowPa
      >g
      >eFilter.java:279)
      > at
      >org.apache.beehive.netui.pageflow.PageFlowPageFilter.doFilter(PageFlowP
      >a
      >geFilter.java:204)
      > at
      >org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
      >a
      >tionFilterChain.java:186)
      > at
      >org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
      >t
      >erChain.java:157)
      > at
      >org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispat
      >c
      >her.java:704)
      > at
      >org.apache.catalina.core.ApplicationDispatcher.processRequest(Applicati
      >o
      >nDispatcher.java:474)
      > at
      >org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDis
      >p
      >atcher.java:409)
      > at
      >org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispa
      >t
      >cher.java:312)
      > at
      >org.apache.beehive.netui.pageflow.internal.DefaultForwardRedirectHandle
      >r
      >.forward(DefaultForwardRedirectHandler.java:127)
      > at
      >org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.doForward(Pa
      >g
      >eFlowRequestProcessor.java:1750)
      > at
      >org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processForwa
      >r
      >dConfig(PageFlowRequestProcessor.java:1624)
      > at
      >org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
      >231)
      > at
      >org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInter
      >n
      >al(PageFlowRequestProcessor.java:591)
      > at
      >org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(Page
      >F
      >lowRequestProcessor.java:852)
      > at
      >org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(Aut
      >o
      >RegisterActionServlet.java:606)
      > at
      >org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlo
      >w
      >ActionServlet.java:162)
      > at
      >org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
      > at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
      > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      > at
      >org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
      >a
      >tionFilterChain.java:237)
      > at
      >org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
      >t
      >erChain.java:157)
      > at
      >org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispat
      >c
      >her.java:704)
      > at
      >org.apache.catalina.core.ApplicationDispatcher.processRequest(Applicati
      >o
      >nDispatcher.java:474)
      > at
      >org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDis
      >p
      >atcher.java:409)
      > at
      >org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispa
      >t
      >cher.java:312)
      > at
      >org.apache.beehive.netui.pageflow.internal.DefaultForwardRedirectHandle
      >r
      >.forward(DefaultForwardRedirectHandler.java:127)
      > at
      >org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.doForward(Pa
      >g
      >eFlowRequestProcessor.java:1750)
      > at
      >org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processForwa
      >r
      >dConfig(PageFlowRequestProcessor.java:1624)
      > at
      >org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
      >231)
      > at
      >org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInter
      >n
      >al(PageFlowRequestProcessor.java:591)
      > at
      >org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(Page
      >F
      >lowRequestProcessor.java:852)
      > at
      >org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(Aut
      >o
      >RegisterActionServlet.java:606)
      > at
      >org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlo
      >w
      >ActionServlet.java:162)
      > at
      >org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
      > at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
      > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      > at
      >org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
      >a
      >tionFilterChain.java:237)
      > at
      >org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
      >t
      >erChain.java:157)
      > at
      >org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal
      >v
      >e.java:214)
      > at
      >org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC
      >o
      >ntext.java:104)
      > at
      >org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
      >5
      >20)
      > at
      >org.apache.catalina.core.StandardContextValve.invokeInternal(StandardCo
      >n
      >textValve.java:198)
      > at
      >org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal
      >v
      >e.java:152)
      > at
      >org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC
      >o
      >ntext.java:104)
      > at
      >org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
      >5
      >20)
      > at
      >org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav
      >a
      >:137)
      > at
      >org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC
      >o
      >ntext.java:104)
      > at
      >org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav
      >a
      >:118)
      > at
      >org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC
      >o
      >ntext.java:102)
      > at
      >org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
      >5
      >20)
      > at
      >org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
      >java:109)
      > at
      >org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC
      >o
      >ntext.java:104)
      > at
      >org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
      >5
      >20)
      > at
      >org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
      > at
      >org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
      > at
      >org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:7
      >9
      >9)
      > at
      >org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process
      >C
      >onnection(Http11Protocol.java:705)
      > at
      >org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:5
      >7
      >7)
      > at
      >org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPoo
      >l
      >.java:683)
      > at java.lang.Thread.run(Unknown Source) Caused by: SQL
      >Exception: Invalid transaction state.
      > at
      >org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java)
      > at
      >org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java)
      > at
      >org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java)
      > at
      >org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(EmbedConnect
      >i
      >on.java)
      > at
      >org.apache.derby.impl.jdbc.EmbedConnection.close(EmbedConnection.java)
      > at
      >org.apache.beehive.controls.system.jdbc.JdbcControlImpl.onRelease(JdbcC
      >o
      >ntrolImpl.java:131)
      > ... 104 more
      >
      >
      >----Original Message----
      >From: Richard Feit
      >Sent: Thursday, May 12, 2005 2:43 PM
      >To: Beehive Developers
      >Subject: Re: Error page within other page
      >
      >Quick question: where is the error being generated in the page flow?
      >In an action method? In a property getter?
      >
      >Rich
      >
      >Scott Semyan wrote:
      >
      >
      >
      >>I have a page which is currently generating an error. Instead of being
      >>redirected completely to the error page, the first part of my template
      >>is being rendered, then the error page.I thought any error would
      >>redirect without rendering any of the page that generates the error.
      >>The error happens in the page flow so I don't know why it is rendering
      >>part of the other page. Again, this seems to be new behavior...
      >>
      >>Scott Semyan
      >>
      >>
      >>
      >>
      >>
      >>
      >
      >
      >
      >
      >

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Scott Semyan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development